Having Trouble - Simple thing..
I'm trying to make a script so if you select a value in the select box of either 1, 2 or 3 differnet Divs will show. Ideally i want all 3 divs to show if you select 3, or 2 to show if you select 2, or only 1 to show if you select 1.
Here is a sample of the script:
<script language="JavaScript"><!--
function UpdateList(x) {
if (x.options[x.selectedIndex].value == "1") {
document.getElementById("Products_1").style.display = "";
}
if (x.options[x.selectedIndex].value == "2") {
document.getElementById("Products_2").style.display = "";
}
if (x.options[x.selectedIndex].value == "3") {
document.getElementById("Products_3").style.display = "";
}
}
//--></script>
The select box:
<select name="items1" class="select" id="items1" onChange="UpdateList(this);">
<% c=3
for i = 1 to c %>
<option><%=i%></option>
<%Next%>
</select>
Sample div:
<div id="Products_<%=i%>" style="display:none;">text here.
</div>
Any help would be greatly appreciated!