New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to wait ajax done to process next step? #20
Comments
Let's try this way, cancel the var ajaxInvoke = false;
$wizard.on('leaveStep', function(e, anchorObject, stepNumber, stepDirection) {
if (stepDirection === 'forward' && stepNumber === 2 && ajaxInvoke ==false) {
ajaxInvoke = true;
$.ajax({
method: 'POST',
url: url,
data: data
}).then(function (response) {
// indicate the ajax has been done, release the next step
$wizard.smartWizard("next");
}, function (){
// hang on this step if the error occur
});
return false;
}
}); |
Hi, im sorry for not response for that long. Your idea is perfectly fit what i want, thank you so much! |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I have a wizard with 3 steps and in the step 2 I want to send an ajax request, how do i wait for the ajax call finish to show the step 3 which indicate the wizard has been finished?
My current code as bellow:
The text was updated successfully, but these errors were encountered: