javascript for a drop down menu

Discussion in 'JavaScript' started by selfAfflicted, Aug 13, 2008.

  1. #1
    I would like the user to be able to click on the drop down list, and start typing to find a word. Right now you can do this, but you have to do it fast, and it doesn't work in >ie7. Right now I have users and they are trying to do this, by typing in j-a-v-a

    the ddl will jump from j-javascript to a-apple to v-vase to a-apple instead of staying on the word javascript.

    any suggestions would help.

    this is just done in html at the moment, but I figured if there was a solution it would have to be done in javascript.

    <select name="letters">
    <option>a</option>
    <option>ab</option>
    <option>ac</option>
    <option>ba</option>
    <option>bb</option>
    <option>bc</option>
    <option>ca</option>
    <option>cb</option>
    <option>cc</option>
    </select>
     
    selfAfflicted, Aug 13, 2008 IP
  2. Sleeping Troll

    Sleeping Troll Peon

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    A-J-A-X! Don't let it scare you, if you are familiar with the httprequest object and any server script, the only real difference is that xmlhttprequest object is asynchronous.
     
    Sleeping Troll, Aug 14, 2008 IP
  3. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No AJAX is required here. You can do that with simple javascript. Insert all the available options into an array and when the user types in his search, check the array for matches and display only the options that match the search.
     
    xlcho, Aug 14, 2008 IP
  4. selfAfflicted

    selfAfflicted Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You probably don't have an example of this lying around anywhere, do ya?
     
    selfAfflicted, Aug 15, 2008 IP
  5. koolman

    koolman Peon

    Messages:
    76
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You may look for free "javascript autocomplete" to see how
     
    koolman, Aug 16, 2008 IP