Mittul At TechnoBrave
Mittul At TechnoBrave

Reputation: 1242

jQuery Form Validator OnSuccess with Alertify not working

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 ?

Upvotes: 0

Views: 190

Answers (0)

Related Questions