jQuery-Form-Validator icon indicating copy to clipboard operation
jQuery-Form-Validator copied to clipboard

Unable to validate form on submit by jquery via ajax

Open azadhussain16 opened this issue 7 years ago • 1 comments

Ho can I prevent form submission if there is any invalid fields in the form I am submiting the form on submit by ajax.

azadhussain16 avatar Jul 27 '18 05:07 azadhussain16

Something like this

$.validate({
    form : '#registration-form',
    modules : 'security',
    onSuccess : function($form) {
      // send form with ajax
      myAjaxFunc($form);
      return false; // Will stop submission of the form
    }
});

victorjonsson avatar Aug 22 '18 06:08 victorjonsson