struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Weber <>
Subject Re: [OT] "Enter" key listener for form submittal
Date Thu, 02 Sep 2004 23:09:57 GMT
Wendy, I have three visible buttons, a cancel, then a reset and a 
submit. So I added the hidden submit as the first button, moving the 
visible buttons to the right. The HTML rendered for all four buttons by 
the Struts tags is (I added the line breaks):

<input type="submit" value="Submit" style="display:none">
<input type="submit" name="org.apache.struts.taglib.html.CANCEL" value="Cancel" onclick="bCancel=true;">
<input type="reset" value="Reset">
<input type="submit" value="Submit">

But for some reason, the "Enter" key still seems to trigger the cancel 
button in IE (I honestly don't know about IE 6 but I tested it in IE 5). 
Same story with the JavaScript I tried that is supposed to listen for 
the "Enter" key press. Both work in Mozilla 1.7.

Perhaps you could share your variation.


Wendy Smoak wrote:

>From: "Erik Weber" <>
>>Rick, I tried putting a hidden submit button (<html:submit
>>style="display:none"/>) in front of my cancel button to intercept the
>>"Enter" key, but again, this worked in Mozilla but not IE (just like my
>>key listener JavaScript).
>>So I'm still looking for an Enter key listener that is portable. I
>>haven't tried every suggestion I got though.
>What HTML did that render?
>I have a "hidden" submit button that intercepts the enter key, but it's
>hidden by virtue of having no text and a blank .gif as its image, so the
>background of the page shows through.  It really is there on the page, but
>you can't see it.  It works in IE 6.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message