Originally Posted by CreativeLogic
If it's in the form use onsubmit within the form tag.
|
Or, unobtrusively attach the submit handler onload/domready. You're using Prototype so it's easy to do that using
Event.observe, also make use of the
$ function rather than
document.getElementById.
If you use the form's submit event, there's no need to look for which key was pressed, playing with the submit button, etc.