Click to See Complete Forum and Search --> : Modal dialog - how to disable enter? (JavaScript)


TAHbKA
September 26th, 2004, 07:00 AM
I have a modal dialog which is opened by showModalDialog. On the dialog there are 2 buttons and a password field. All that in JavaScript

The problem:
When I press the "enter" key of the keyboard while the focus is on the password field (say, when I'm in the middle of password typig) another window opens (and naturally, I don't want it to). How can I disable it? I don't want another window to open (happens only when the focus is on password, when the focus is on one of the buttons it just activates them). What should I do? Disable the "enter" ? If so, how? Is there any trick with a focus?


My first post here, please let me know if something is out of order, so I won't repeat the mistakes.

Thanks!

PallaviDalvi
September 29th, 2004, 02:15 AM
Tried to do exactly like u mentioned...but my example works fine. which brings me to ask -- the window thats opened on the 'enter-keypress', what does it show? are u creating/calling this at any point from ur code?
generally any action is taken on the Enter key when a default(submit) button is specified...check if u've done any such thing. get back with any further details that might further help... possibly ur piece of code.