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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Visibility

Status
Not open for further replies.

sevex

Programmer
Sep 18, 2001
74
CA
Alright... I'm completely lost... I don't know what I'm doing. I have a select list, and depending on which option is selected, a different second select list will be "displayed" on the site. Here's what I have so far, and it doesn't do anything.

in header:
<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
change(select) {
document.sub1.style.visibility='hidden';
document.sub2.style.visibility='hidden';

document.select.style.visibility='visible';
}
</script>

body (first select):
<select name=&quot;profile&quot; size=&quot;1&quot;>
<option value=&quot;&quot; selected>Select a Profile</option>
<option value=&quot;1&quot; onClick=&quot;change(sub1);&quot;>Community Profile</option>
<option value=&quot;2&quot; onClick=&quot;change(sub2);&quot;>Investment Profile</option>
</select>

body (first of the second set):
<span id=&quot;sub1&quot; style=&quot;visibility:hidden&quot;>
<select name=&quot;sub&quot; size=&quot;1&quot;>
<option value=&quot;&quot; selected>Select a Section</option>
<option value=&quot;1&quot;>Summerside within PEI</option>
<option value=&quot;2&quot;>Economic Indicators</option>
<option value=&quot;3&quot;>Site Selection</option>
</select>
</span>

any help will be greatly appreciated.
 
Functions must be preceded by the word function:

<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
function change(select)
{
....
 
I just noticed that and was coming here to mention it before everyone saw how much of a moron I am... guess I was too late eh? :p

 
We all have our days. Some of us are just too slow to expose them, though. :)#
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top