1$( document ).ready( function(){setupForms();} );
2
3function setupForms(){
4
5 var ajaxOptions = { beforeSubmit:checkForm,
6 success:function(){
7 // the ajax was successful
8 }
9 };
10
11 $( '.ajaxForm' ).ajaxForm( ajaxOptions );
12 $( '.ajaxForm' ).validate();
13}
14
15function checkForm(data,form){
16 var valid = $(form).valid();
17 return valid;
18}
19