![]() |
preventDefault() in Opera and Netscape
I have built a Google Suggest type dropdown suggestion box. When it is open, the user can use the mouse OR keyboard to navigate it. If they use the keyboard, the up/down arrows should navigation options, and the enter should "select" and option...but NOT submit the form. Herein lies the problem. I'm using this code in an onkeydown event attached to the input field:
:
if (this.asc.style.visibility != 'hidden') {The code works in IE and Firefox, but NOT in Netscape, Opera, K-Meleon, etc. Instead in those browsers it "selects" the option (this.selectOption();) AND submits the form. Also, if you are part of Experst-Exchange, feel free to get some points |
1 Attachment(s)
I realized that a paste-bin would be useless for future people finding this post. I'm attaching the code. In the attached version, the problem area starts on line 109
|
| All times are GMT -5. The time now is 1:11 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC