Pingili, Madhupal wrote:

I am converting a VB application to Web application.
I need to select an option from a drop-down list box as the user
enters a value in that box. For example, there are four values in that drop-down box:
one, two, three, four As the user types say "f" or "fo", I need to select the option "four".
Can anyone share some ideas to do that?
BTW, I am using Struts actions and JSP to build the page that contains the
option list.


When the pull-down has focus and you press a letter, the web browser will normally select the next item in the list with that letter. Eg if you have the following list

 one
 two
 three
 four

and you press 't', it will select 'two', if you press 't' again it will select 'three'.

I seem to remember seeing someone do what you described where typing 'th' will go to 'three'. I believe you need to use Javascript to catch the key-press (or was it the key-release?) event. Then store the key presses in a javascript variable - also have to take into account backspace - and after each key press search the pull-down list for the match. I am pretty sure the code to do this is horrible as it has to deal with both the IE and Netscape event model and what to do if the arrow keys are used to move up down etc.

--
Jason Lea




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to