[jQuery] Validation Success Callback
I am using the validation plugin and the form plugin to validate my
form and then submit the information via ajaxSubmit. I have everything
working with the exception of my success callback function. Once the
form is successfully validated I just want to wait about 2 - 3 seconds
to run a script and then redirect the user to a new page. This works
but the code is executed immediately:
var options = {
success: createAccount,
clearForm: true
};
$("#submitForm").validate({
rules: {
//Insert Rules Here
},
messages: {
//Insert Messages Here
},
submitHandler: function(form) {
jQuery(form).ajaxSubmit(options);
}
});
function createAccount () {
//Do Stuff
setTimeOut(//Redirect, 2000);
}
So instead of waiting 2 seconds to redirect the code is executed as if
the timer isn't even there!! Can anyone please help me with this? I
have tried everything and still the timer does not work!!