Mon 4 Aug 2008
JavaScript forms submit gotcha!
Posted by Robin Layfield under Web Development, geek stuff
I’ve just lost about an hour and a half of my life to a cheeky little JavaScript gotcha. I thought I’d document it here in the vain hope that it didn’t get anyone else.
If you have a button on your form that is named “Submit” then beware! As soon as this button goes into the DOM, it will over-ride the form’s Submit() method, meaning that you can no longer call that from JavaScript or JQuery or whatever you are using.
Make sure you give the button a different name, or even no name at all, for your own peace of mind!
No Responses to “ JavaScript forms submit gotcha! ”
Leave a Reply
You must be logged in to post a comment.