Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list box to hide/display DIV 1

Status
Not open for further replies.

onressy

Programmer
Joined
Mar 7, 2006
Messages
421
Location
CA
Hi, i'm having issues with this, would appreciate some fresh eyes: Thanks!

<style type="text/css"> #a1, #a2, #a3, #a4, #a5 { DISPLAY: none; } </style>

<script type="text/javascript">
function Toggle(determine) {
document.getElementById("a1").style.display = "none";
document.getElementById("a2").style.display = "none";
document.getElementById("a3").style.display = "none";
document.getElementById("a4").style.display = "none";
document.getElementById("a5").style.display = "none";
document.getElementById(determine).style.display = "block";
}
</script>

///////////////////////////////////////////////////////


<select size="1" name="determine" onChange="Toggle(document.determine.getElementById.value);">
<option value="a1">This</option>
<option value="a2">That</option>
<option value="a3">Here</option>
<option value="a4">There</option>
<option value="a5">Some</option>
</select>

///////////////////////////////////

<div id="a1">this</div>
<div id="a2">that</div>
<div id="a3">here</div>
<div id="a4">there</div>
<div id="a5">some</div>
 
Code:
<select size="1" name="determine" onChange="Toggle([!]this[/!].value);">

-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top