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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts

    how to select a checkbox and all the drop down list set to the same?

    dear,

    how to select a checkbox and all the drop down list will auto select to same value with the first drop down list?

    example:
    <input type=checkbox name=checkall value="y" onclick="Selectall()">
    Same All</p>
    <p> First Site:
    <select name="uom1" size="1">
    <option value="1">Technology Sites1</option>
    <option value="2">Technology Sites2</option>
    </select>
    </p>
    <p> Second site:
    <select name="uom2" size="1">
    <option value="1">Technology Sites1</option>
    <option value="2">Technology Sites2</option>
    </select>
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    if the order of items in uom1 correspond to the same order of items in uom2:

    <script>
    function Selectall(objChk){
    if (objChk.checked){
    objChk.form.uom2.selectedIndex = objChk.form.uom1.selectedIndex;
    }
    }
    </script>
    ...
    <input type=checkbox name=checkall value="y" onclick="Selectall(this)">
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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