I m using jQuery-step library with a form combining the formvalidation.js . i want to delay below method response until ajax complete.
i want to send return true/false when ajax complete.
onStepChanging: function (e, currentIndex, newIndex) {
var fv = $stepForm.data('formValidation'), // FormValidation instance
// The current step container
$container = $stepForm.find('section[data-step="' + currentIndex + '"]');
// Validate the container
fv.validateContainer($container);
var isValidStep = fv.isValidContainer($container);
if (isValidStep === false || isValidStep === null) {
// Do not jump to the next step
return false;
}
if (isValidStep === true) {
//call ajax here
//wait for ajax to complete then move to next or keep
}
return true; //-> i want to delay this
},