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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Location
    Des Moines, Iowa
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find selected order of a multiple select

    Apparently my Google skills are failing.

    Is there a way to find in which order the selects were selected in a multiple-select select box?

    For example: I select the 5th option then the 3rd then the 8th. Can JavaScript determine in which order that happened?

    Thanks!
    Rich
    Rich S. Wyatt
    D3 Web Creations

  • #2
    New Coder
    Join Date
    Dec 2006
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hello Rich,

    Could you not use the select boxes onChange event to store its index numbers in a hidden textbox?

    <select id = "sel1" onchange = "clickOrder()">
    <option value = 1>1
    <option value = 2>2
    <option value = 3>3
    </option>
    </select>

    <input type = "hidden" id = "hidden1">

    <script language = "javascript">
    function clickOrder()
    {
    var hiddenBox = document.getElementById("hidden1").value
    var selValue = document.getElementById("sel1").selectedIndex

    hiddenBox+=selValue
    }
    </script>

    Not tested, but is this what you're getting at?

    HTH
    Joe

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Location
    Des Moines, Iowa
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <Sigh>

    Always making things harder than they need to be.

    Yes - this is it.

    Thanks!
    Rich S. Wyatt
    D3 Web Creations


  •  

    Posting Permissions

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