SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scrolling to the right line of a select box

    I have a <select>box with about 30 option-items.
    The size of the <select> is 5. So, you can't see all the items, you have to scroll.

    Thru checking with a database I have selected the correct line or lines in the select-box... (it is a multiple <select>)

    However, Is it possible to scroll down to that line automatically? So, that the first option that is selected appears at the top of the <select> box?

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    .
    Last edited by bsacks; Jun 7, 2001 at 10:02.

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes,
    Use JavaScript.
    You have to figure out the exact syntax because I don't recall at the moment. But, it is pretty simple.

  4. #4
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone know which JavaScript to use?
    I have no idea where to look for...

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry,
    It's something like
    document.form[0].element.options[document.form[0].element.selectedIndex].checked or value or text

    It is a little tough to work with selects sometimes in JavaScript. But, there are a ton of good tutorials out there.


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
  •