Is it possible to stop a form from submitting and then resubmitting the same form from within the success of an ajax call?
At the moment it gets to the success bit b
In one line you use $('form')
to select the form to change its action, but then you use $(this)
to try to select that same form. I would guess that this
inside the callback function isn't what you expect it to be, and is something other than your form (possibly the window
object).
Just chain the calls:
$('form').attr('action', 'http://example.com').unbind('submit').submit();