[jQuery] Replacing an inline onkeypress
I'd like to make use of this function:
http://jennifermadden.com/javascript/stringEnterKeyDetector.html
to prevent the enter key from submitting forms (we'll be using barcode
scanners to enter data into a form, and we don't want forms submitted
prematurely).
That script as it is requires the addition of an onkeypress attribute
for specific form fields. I'd like to do something like this:
$("#myform input").keypress( function() { return
checkEnter(event); } );
...but I don't know "event" gets properly passed without using the
inline onkeypress.
Thanks,
Owen