I don't know if there is a Struts-specific way to do it, but if you just attach an onKeypress handler to the form element and return false if the keycode is 13, that should do it:

<form onKeypress="if(keyCode==13){return false;}">

That keyCode variable might not be correct, I'm going from memory, but it's close, a quick Google search should give you the right answer if I'm wrong. Not that this will stop enter working on ANY field, so if that's important, this won't work. You might also be able to check the keyCode onSubmit, but I'm not as sure about that.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

[EMAIL PROTECTED] wrote:




Anyone know how to stop a struts form from being submitted when the Enter
key is pressed and focus isn't on the submit button?
(ie I still want Enter to work - I just don't want Enter to equate to
pressing submit).


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]









---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to