victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
973 stars 477 forks source link

jQuery Form Validator OnSuccess with Alertify not working #734

Open mittultechnobrave opened 5 years ago

mittultechnobrave commented 5 years ago

I am using jQuery Form Validator with Alertify JS and I am using below code to check if my form successfully validated or not.

onSuccess : function($form) {
  alertify.alert('a callback will be invoked on ok.').set('onok', function(closeEvent) { 
    return true;
  }); 
  return false; // Will stop the submission of the form
},

Here what I am trying to do is, if I press OK From Alertify then my form should be submitted.

But as of now, if I remove return false; then my Alertify not showing and my form gets submited.

I also tried to put $('#my-form-id').submit() inside return true; but yet its not working.

Basically I just want to show my Alertify before form gets submitted just to notify the user with my alert box. But it seems above things not working for me correctly.

Here is the jQuery Form Validator configuration documentation which I have followed.

Can someone guide me what I am doing wrong here ?