Fixing lowpro form submission failures
Posted Thursday, April 03, 2008I finally worked out why my forms weren’t submitting when the user hits the ENTER key. lowpro serializes the button that was clicked along with any other parmeters when submitting a form via AJAX. However, when the user hits enter under FireFox, there is no button and consequently the browser barfs. Safari on the other hand tries to be too helpful and triggers an onclick event for the first submit button (which is why I never noticed it).
So anyway, rather than try to be too clever myself, I simply changed the parameter serialization in Remote.Form.onsubmit to look like:
parameters : this.element.serialize({ submit: this._submitButton ? this._submitButton.name : null })
Problem solved.
About Simon
Husband, Father, One-time Entrepreneur.
Aka Haruki Zaemon. Aka Sampy.
In my younger years I wanted to save the world; now I'm happy solving bigger problems than I create.
If I didn't need to work I'd be teaching Aikido and spending all my free time with my amazing wife and two children in Woodend, Victoria, Australia.
Books
Beginning Algorithms
with James Ross

COMMENTS
blog comments powered by Disqus