Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts

    scrolling a listbox

    I have a long<SELECT> how can I directly scroll to the first selected item ? tank you

  • #2
    umm
    umm is offline
    Regular Coder
    Join Date
    Sep 2002
    Location
    Antipodes
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, do you mean that you want a default selected item in the select list? I don't quite understand your question.

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts

    no

    no my select is server side fill from a database and the items are allready selected
    it is for an update
    if one of the last item is selected you don't see it at once that
    then I would like to scroll to the first selected item

    ....to the first because generally I use a multiselect

    thank you

  • #4
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you want it so that when someone clicks on an option in your drop down the list bounces back to the first item, insert this line of code into your first <select> tag...

    onChange="MM_jumpMenu('parent',this,1)"

    If you change the 1 to a zero it will reverse the effect.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Netherlands
    Posts
    217
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you have a select,you can set put the selected="selected" attribute in an option and it will scroll to that item.
    Heres an example:
    Code:
    <select>
    <option value="0">zero</option>
    <option value="1">one</option>
    <option value="2">two</option>
    <option value="3">three</option>
    <option value="4">four</option>
    <option value="5">five</option>
    <option value="6">six</option>
    <option value="7">seven</option>
    <option value="8">eight</option>
    <option value="9">nine</option>
    <option value="10">ten</option>
    <option value="11" selected="selected">eleven</option>
    </select>

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts

    it doesn 't work

    strange it doesn't work


    I have that kind

    <select>
    <option value="0">zero</option>
    <option value="1">one</option>
    <option value="2">two</option>
    <option value="3">three</option>
    <option value="4">four</option>
    <option value="5">five</option>
    <option value="6">six</option>
    <option value="7">seven</option>
    <option value="8">eight</option>
    <option value="9">nine</option>
    <option value="10">ten</option>
    <option value="11" selected="selected">eleven</option>
    </select>


    but it doesn't scroll to the number 11 (in that case) so I dont know if soemthing is selected or not , I think I must ask to an asp net section ..

    thanks to all !

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Netherlands
    Posts
    217
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Eh,the "eleven" option is selected and visible,I tested it in Mozilla,Konqueror and even Lynx...

  • #8
    Regular Coder
    Join Date
    Jul 2002
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts

    yes

    yes you are right into a normal html page it works
    I must look what's the reason ... ASP NET is super but sometimes !....:-)))

    thank you

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Netherlands
    Posts
    217
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Lol,okay


  •  

    Posting Permissions

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