...

View Full Version : how to select a checkbox and all the drop down list set to the same?



NinjaTurtle
02-26-2003, 05:09 AM
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>

glenngv
02-26-2003, 07:14 AM
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)">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum