faqts : Computers : Programming : Languages : JavaScript : Event handling

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 13 people (77%) answered Yes
Recently 7 of 9 people (78%) answered Yes


How do I prevent auto submit in NN6?

Oct 3rd, 2003 08:51
freddy rios, Don Edstrom,

>I am using the following code in Netscape 6 (this code works fine in 
>IE5 and NN4.7).  The code does some special handling on text box when 
>the <enter> key is pressed.  When the function returns, the return 
>false should prevent the page from being submitted, but that is not 
>happening. The page is submitted anyway.
>if (thekey==13)
>     returnKeyHandler(); return false;
This was happening to me just a second ago, seeing this answer made me 
tough the problem was something else, and in fact it was ...
I was using the onkeydown event, which made the problem you said 
happen, now I am using onkeypress event, and everything is working 
great :):)