表格提交原型

时间:2012-07-30 14:30:11

标签: jquery javascript-events prototypejs

我需要在原型中编写这个jquery函数。我该如何转换它?

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

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

},

1 个答案:

答案 0 :(得分:1)

尝试:

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

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