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

Making dropdown's appear based on another dropdown selection 5

Status
Not open for further replies.

VAMick

Programmer
Nov 18, 2005
64
US
I'm attempting to have 2 other dropdowns appear or hide based on a selection from the first dropdown.
I'd like them both to be invisible when the page loads and then to appear if a certain selection if picked from the first dropdown. Could you please assist in the making them invisible when it loads?
Here is the code I have so far, and it partially works in that if one is selected the other disappears. But that's as far as I could get it to work. Thanks.

<code>
<select name="oaid" class="TextField" id="oaid"
onchange="if (this.value=='12') {
document.getElementById('oid').style.visibility='visible';
document.getElementById('wcfoffice').style.visibility='hidden';}
if (this.value=='14') {
document.getElementById('oid').style.visibility='hidden';
docuement.getElementById('wcfoffice').style.visibility='visible';}"
>
<?php
do {
?>
<option value="<?php echo $row_rs_oalist['oaid']?>"><?php echo $row_rs_oalist['oa_name']?></option>
<?php
} while ($row_rs_oalist = mysql_fetch_assoc($rs_oalist));
$rows = mysql_num_rows($rs_oalist);
if($rows > 0) {
mysql_data_seek($rs_oalist, 0);
$row_rs_oalist = mysql_fetch_assoc($rs_oalist);
}
?>
</select>
</div></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="right">OST Office: </div></td>
<td><select name="oid" id="oid">
<option value=" "></option>
<?php
do {
?>
<option value="<?php echo $row_rs_ostoffice['ostid']?>"><?php echo $row_rs_ostoffice['ost_office']?></option>
<?php
} while ($row_rs_ostoffice = mysql_fetch_assoc($rs_ostoffice));
$rows = mysql_num_rows($rs_ostoffice);
if($rows > 0) {
mysql_data_seek($rs_ostoffice, 0);
$row_rs_ostoffice = mysql_fetch_assoc($rs_ostoffice);
}
?>
</select></td>
<td>WCF Office: <select name="wcfoffice" id="wcfoffice">
<option value=" "> </option>
<option value="0402001000">0402001000</option>
<option value="1005001000">1005001000</option>
<option value="1203001000">1203001000</option>
<option value="1204002000">1204002000</option>
<option value="1901002000">1901002000</option>
<option value="1202014000">1202014000</option>
</select></td>
</code>
 
Or a search in this forum - this is a question that is asked about every 3 days.

-kaht

Looking for a puppy?

[small]Silky Terriers are small, relatively odorless dogs that shed no fur and make great indoor pets.[/small]
 
Who would think of going to a kaht for a puppy?


At my age I still learn something new every day, but I forget two others.
 
Well I tried a search, but the page loaded only 4 threads and kept giving a page error, so I gave up and posted. But hey, thanks for the info.

Billy, you were helpful. Thanks. Star for you.
 
I think the
Code:
[puppy]
[puppy] emoteicon was added specifically for people selling puppies.


I don't know the answer but my good friend Google does.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top