I have 2 forms. The first one is an async post that populates the data for form 2. I then want to submit form 2 synchronously so the users browser is redirected to a the new page. However the following code doesn’t seem to be doing the job.
$('#Form1').ajaxForm({
success: function(data) {
//returns a complete form
$('body').append((data));
//the following works so I know the jquery selector is recognized
console.log($('#Form2'));
//however this does not work
$('#Form2').submit()
}
})
Is this not a valid method for submitting a form, or am I just missing something here? Thanks.
Is it possible that form2 has a submit button with an id or name of “submit?”