| Article: |
Cooking with JavaScript & DHTML | |
| Subject: | numbers as option text? | |
| Date: | 2004-01-16 11:02:13 | |
| From: | dannyg1 | |
|
Response to: numbers as option text?
|
||
|
With the onkeydown event, we're dealing with key codes, not character codes. The key codes for the numeric keypad are different from the key codes across the top of the keyboard. But there is an simple relationship between the two sets, and the way to account for it is to insert a small corrector statement in the typeAhead() function after the line that reads: var charCode = evt.keyCode. Here's the new code to add:
|
||
Showing messages 1 through 3 of 3.
-
numbers as option text?
2004-10-11 07:50:13 wolffy [View]
-
numbers as option text?
2004-10-14 12:05:34 Danny Goodman |
[View]
10+K entries! No wonder you've been looking for this kind of functionality. :-)
Unless IE does something innately weird when a select element's options exceed 9168 (a stress point, I would imagine), I can think of a couple things to try.
First, experiment with longer values for thedelayproperty of thetypeAheadInfoobject constructor function.
It's also possible that with so many options, the scripting bogs down with repeated fetches of the options for each keystroke. Perhaps rework the code to perform the retrieval just once (at onload time) and preserve the list in a global variable for faster subsequent retrievals.
-
numbers as option text?
2004-10-14 12:07:29 Danny Goodman |
[View]
(Sorry about the bad formatting.)
Let me try that again:
First, experiment with longer values for thedelayproperty of thetypeAheadInfoobject constructor function.



Thanks,