user1077300
user1077300

Reputation: 423

Form submit in prototype

I need to write this jQuery function in prototype. How can I convert it?

submitHandler: function(form) {                                             
    $.post("post.php?"+$("#form1").serialize(), {       
        }, function(response){                                                          

             if(response==0)
                 {                                                      
                  alert("security code is wrong!");
                  return false;
                 }                                                  
           }
    );

},

Upvotes: 0

Views: 257

Answers (1)

Danil Speransky
Danil Speransky

Reputation: 30453

Try:

new Ajax.Request('post.php?' + $('form1').serialize(), {
  onSuccess: function (transport) {
    var response = transport.responseText;

    if (response == 0) {                                                      
      alert("security code is wrong!");
      return false;
    } 
  }
});

Upvotes: 1

Related Questions