using setTimeout to auto-submit a form not working
I have a confirmation page that, when loaded, has a form that's posted using ajaxSubmit. Works great but I want to enhance the user experience by auto-submitting the form. However, I want to leave the submit button in-tact just in case there's an issue with the timer.
here's what I have, I wonder why it isn't working?
- $(document).ready(function() {
var options = {
target:'#result'};
setTimeout(function(){$('#formconfirm').submit(function() {
$(this).ajaxSubmit(options);
return false;
});
},2500);
});
Thanks in advance to anyone who can help.