PDA

View Full Version : Help me how to use this list box



trestian
02-14-2006, 04:21 AM
Good day..

im new in using javascript.

my problem is regarding the list box and how to used it in the javascript
Scenario.
this is the following list in my list box

- Philippines
- hungary
- italy
- ukraine

when i type p it will do in the philippines and the second letter h it will go to hungary.

my problem is how to do it that if i type p,h,i it will go to philippines or if i type a letter (h,u,n) he will test all the corresponding value of the listbox

jscheuer1
02-14-2006, 07:17 AM
Not sure I understand. What you are referring to is called a select. Here is a very simple one with your content:


<select>
<option>Philippines
<option>hungary
<option>italy
<option>ukraine
</select>

Now, what value do you want to test? The value of the words? A value that you might add? :


<select>
<option value="phil.htm">Philippines
<option>hungary
<option>italy
<option>ukraine
</select>

Or something else? Do you really mean test the value or do you mean retrieve the value? Let's get these basics settled first.

trestian
02-14-2006, 07:31 AM
Good day sir...

my problem is regarding the users selection in the listbox.

because in the listbox the default in onkeypress is if you press P it will go in a value that start in P if H in H.... it is correct?

listbox

- philippines
- italy
- hungary

i want to do is if you press example(1st p then second h) so it will go to phillippines not in hungary.

jscheuer1
02-14-2006, 12:27 PM
I'm not aware of any method that can make the browser know that, in effect, you are not finished pushing keys yet. You could have an input field to submit the (full or partial) search string.