SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict Caryn's Avatar
    Join Date
    Aug 2002
    Location
    Sydney, Australia
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Select Menu and keyboard shortcuts

    I'm having trouble with a select menu. I know that I can use the accesskey attribute to select an option within the menu, but I want the user to be able to type in strings to find what they are looking for.

    For example:

    HTML Code:
    <select name="select" size="6">
     	<option accesskey="bat">Bat</option>
     	<option accesskey="batch">Batch</option>
     	<option accesskey="naught">Naught</option>
     	<option accesskey="naughty">Naughty</option>
       </select>
    I can press "n" on my keyboard to sequentially select all the options starting with "n" in this list. However, I want to be able to type in "batc" and automatically select the "batch" option.

    Is there a way I can do this with javscript? I've searched everywhere but I think I may be using the wrong terminology.

    Thanks in advance.

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    PA
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What browsers do you need to support? If IE only, MS supports HTC (HTML Components). I wanted to create a text box that provided help similar to what you want to do. Someone (Beetle) on this site came up with the HTC solution. I think if you play around with this it will work for you...
    http://www.sitepointforums.com/showt...364#post745364
    MS Site: http://msdn.microsoft.com/library/de...components.asp

    Hope this helps

  3. #3
    SitePoint Addict Caryn's Avatar
    Join Date
    Aug 2002
    Location
    Sydney, Australia
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to support IE, Netscape 6+, and Opera.

    Thanks for your post. Will look at it now.

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The the last post in this thread
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  5. #5
    SitePoint Addict Caryn's Avatar
    Join Date
    Aug 2002
    Location
    Sydney, Australia
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks beetle! That's exactly what I was looking for!


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
  •