Thanks Chip!

I took your 2nd bit of advice and added code to capture the
ENTER key's "key press" event and it worked great.

Here's my Javascript snippet:

function enterKey(event) {
 if (event.which == 13)
    {
      return(false);
    }
}
document.captureEvents(Event.KEYPRESS);
document.onkeypress=enterKey;

THANKS!
Janet


                                                                  
 (Embedded                                                        
 image moved   "[EMAIL PROTECTED]" <chip                        
 to file:      08/04/99 10:03 PM                                  
 pic15755.pcx)                                                    
                                                                  



Please respond to "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:    (bcc: Janet Traub/IS/SSC/THD)
Subject:  Re: [ND] preventing ENTER key from submitting forms w/only ONE textBox





i've done this in the past by putting a
hidden field on the page that is your
"ok to submit" flag which defaults to
false.  check this flag in a method called
from onsubmit of the form.  have the onclick
of of the button set the flag to true.

developer.netscape.com also has some info
on registering and capturing events such as
keystrokes.

-Chip

[EMAIL PROTECTED] wrote:
>
>
>
>I have a ND page that has ONE textBox on it. My browser is Netscape.
>
>When I hit the ENTER key it automatically "submits" my page (even tho' I have
>not coded this behavior via Javascript ). Msut be a Netscape browser default
>feature.
>
>This autosubmit messes up my page in that any Static Text that get their value
>via "wizard binding" get cleared out.
>
>Is there a nice way to prevent this behavior? Or should I just replace the
>wizard binding with manual "setDisplayFieldValue" code?
>
>Thanks!
>Janet
>
>

_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

pic15755.pcx

Reply via email to