[thelist] Cancelling onKeyDown in Netscape 6

.jeff jeff at members.evolt.org
Sun Nov 18 20:32:45 CST 2001


matt,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Matt Feldman
>
> I'm trying to stop a form from submitting when the user
> presses enter on a text field.  In IE 5 and Netscape 4,
> I have a working solution: in the onKeyDown attribute I
> call this function:
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

(rudy, you listening.  here's an entry for your fqa)

if at all possible (and it is in this situation), do not remove browser
functionality the user may be accustomed to already.  the sort of
functionalities i'm referring to are things like right-click context menu,
the back button, and preventing the user from using the enter key to submit
a form.

<poke type="fun">
  bad developer, no cookie.
</poke>

there are valid reasons for wanting to keep the form from submitting when
the user hits enter, but there are ways to do it without breaking the user
interface.  perhaps if you describe in more detail what the actual problem
is someone here can present you with a solution.  i've found that solving
the problem is far better than applying fixes to the symptom like you're
doing now.

thanks,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list