deharris2003
Programmer
Does anyone know of a script that will change the value of all Drop Down Menus when the User Selects a Change All Button?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<HTML
<HEAD>
<SCRIPT>
var dropdowns;
function collectDDs()
{
dropdowns = getElementsByName("ddowns");
}
function clearAll()
{
for(i=0; i<dropdowns.length; i++)
{
dropdowns[i].selectedIndex = 0;
}
}
</SCRIPT>
</HEAD>
<BODY onLoad=collectDDs()>
<SELECT NAME=D1 ID=ddowns>
<OPTION VALUE=NONE>None
<OPTION VALUE=WHATEVER>Whatever
</SELECT>
...
<INPUT TYPE=BUTTON VALUE='Clear All' onClick=clearAll()>
</BODY>
</HTML>
function collectDDs()
{
dropdowns = getElementsByID("ddowns");
}
..
<select name="D1" id="ddowns">
...
[/ignore][code]CodeHere
var dropdowns = new Array();