Ran into a really bizarre bug today.
There is a lot of chatter about the form.submit() functionality in jQuery on its API page. There’s also some results you’ll find on StackOverflow and the like about the functionality just not working. Two interesting bugs seem to be cropping up here…
1) An input field with name or id of “submit” seems to somehow break the functionality of the submit function.
2) It didn’t work at all for me in IE. I didn’t have any of the problems that were pointed out in the thread there, but nonetheless, it continued to throw an error in IE. Which got me thinking… how do folks debug JS code in IE? I would love a legitimate way to walk through and debug JS code without needing to buy Visual Studio.
Anyway, the solution of finding the submit button and clicking it as opposed to submitting the form fixed it. Final code looks like:
Very weird given that I’ve never had an experience like this in jQuery, which I think is a huge compliment to the library.