Results 1 to 4 of 4

Thread: Help me how to use this list box

  1. #1
    Join Date
    Feb 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help me how to use this list box

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not sure I understand. What you are referring to is called a select. Here is a very simple one with your content:

    HTML Code:
    <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? :

    HTML Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default hello sir

    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.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •