javascript - jquery validations not woking when ajax call is there -


i have js code validating form using jquery validations. , after calling ajax.

$('.form').validate({     rules: {         ----      } }); $('#submit').click(function() {      $.ajax(url,{         data:data,         success:onsuccess,         error:onerror,         type:post     });     return false; }); 

onsuccess , onerror simple functions. url predefined

but code not entering validations , directly calling ajax whatever might case.

you should not bind click event on submit button. should place function on submithandler option of jquery validation. this

 $('.form').validate({     rules: {     ----      },     submithandler: function(form){         //your code here..     } }); 

here's jquery validation docs better understand.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -