Re: [OT] "Enter" key listener for form submittal

2004-09-02 Thread Erik Weber
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): But for some reason, the "E

Re: [OT] "Enter" key listener for form submittal

2004-09-02 Thread Erik Weber
Michael, this is the original question I posted (yesterday morning): I found this JavaScript, which is supposed to listen for the "Enter" key on any browser (and submit the form on keypress). However, it doesn't seem to be working in IE:
if (document.layers) document.captureEvents(Event.KE

Re: [OT] "Enter" key listener for form submittal

2004-09-02 Thread Wendy Smoak
From: "Erik Weber" <[EMAIL PROTECTED]> > Rick, I tried putting a hidden submit button ( 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

Re: [OT] "Enter" key listener for form submittal

2004-09-02 Thread Michael McGrady
Erik Weber wrote: Rick, I tried putting a hidden submit button () 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 ever

Re: [OT] "Enter" key listener for form submittal

2004-09-02 Thread Erik Weber
Rick, I tried putting a hidden submit button () 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

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Erik Weber
ruts Users Mailing List Subject: Re: [OT] "Enter" key listener for form submittal It is necessary in my case because it is a requirement specified by the client. On very simple forms, it often won't require any programming. But if you have multiple submit buttons, it becomes a

RE: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Barnett, Brian W.
't know if something like this would work in your situation though. It works in IE and Netscape. -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 01, 2004 9:34 AM To: Struts Users Mailing List Subject: Re: [OT] "Enter" key listener f

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Erik Weber
ry in order to submit a form? -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 01, 2004 9:18 AM To: Struts Users Mailing List Subject: Re: [OT] "Enter" key listener for form submittal David Durham wrote: Erik Weber wrote: I found

RE: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Barnett, Brian W.
Out of curiosity, why is an enter key listener necessary in order to submit a form? -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 01, 2004 9:18 AM To: Struts Users Mailing List Subject: Re: [OT] "Enter" key listener for form submitta

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread David Durham
Erik Weber wrote: Also, does document.forms[0].submit() trigger the submit with a submit value of cancel? Does that make since? Hmm, would it not fail also on Mozilla if that were true? Perhaps. I just glanced at the thread, so I have a cursory understanding of the problem. - Dave -

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Erik Weber
David Durham wrote: Erik Weber wrote: I found this JavaScript, which is supposed to listen for the "Enter" key on any browser (and submit the form on keypress). However, it doesn't seem to be working in IE: if (document.layers) document.captureEvents(Event.KEYDOWN); document.onkeydown = function

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread David Durham
Erik Weber wrote: I found this JavaScript, which is supposed to listen for the "Enter" key on any browser (and submit the form on keypress). However, it doesn't seem to be working in IE: if (document.layers) document.captureEvents(Event.KEYDOWN); document.onkeydown = function (evt) { var keyCode =

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Rick Reumann
Erik Weber wrote: Would this button then need an onclick to submit the form, or is that not necessary? I haven't had to use the approach but I don't think it would be necessary to add an onclick. Just make it's a regular submit button and make sure it's hidden after the tag -- Rick --

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Erik Weber
Rick, this is a new concept to me. Is the strategy to make this button the first one in line on each screen, and therefore it will be the target of the "Enter" key? Would this button then need an onclick to submit the form, or is that not necessary? Thanks, Erik Rick Reumann wrote: Erik Weber w

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Christoph Kutzinski
Slattery, Tim - BLS wrote: I found this JavaScript, which is supposed to listen for the "Enter" key on any browser (and submit the form on keypress). However, it doesn't seem to be working in IE: I don't think you need this. By default, pushing the "Enter" key is equivalent to clicking the "Submi

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Rick Reumann
Erik Weber wrote: I need it because I have multiple buttons. On some screens, the Enter key triggers the "Cancel" button, which is not desirable. The "Cancel" button appears before the "Submit" button. I would think making an extra submit button that was hidden (using css) would be easier. -- R

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Erik Weber
And, now I will repost the code which was omitted in a reply: Erik Weber wrote: I found this JavaScript, which is supposed to listen for the "Enter" key on any browser (and submit the form on keypress). However, it doesn't seem to be working in IE: if (document.layers) document.captureEvents(E

Re: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Erik Weber
I need it because I have multiple buttons. On some screens, the Enter key triggers the "Cancel" button, which is not desirable. The "Cancel" button appears before the "Submit" button. Erik Slattery, Tim - BLS wrote: I found this JavaScript, which is supposed to listen for the "Enter" key on any

RE: [OT] "Enter" key listener for form submittal

2004-09-01 Thread Slattery, Tim - BLS
> I found this JavaScript, which is supposed to listen for the > "Enter" key on any browser (and submit the form on keypress). > However, it doesn't seem to be working in IE: I don't think you need this. By default, pushing the "Enter" key is equivalent to clicking the "Submit" button. -- Tim S

[OT] "Enter" key listener for form submittal

2004-09-01 Thread Erik Weber
I found this JavaScript, which is supposed to listen for the "Enter" key on any browser (and submit the form on keypress). However, it doesn't seem to be working in IE:
if (document.layers) document.captureEvents(Event.KEYDOWN);
document.onkeydown = function (evt) {
var k