...

View Full Version : Need to hide select box ASAP



trsands
01-11-2004, 09:10 AM
My script creates a select using the followig code:

<td colspan="3" rowspan="3" valign="top"><font face="Courier" size="4">
<select name="selChoices" size="10" id="selChoices">
</select>
</font></td>



How do I get the select hide/show at will?

I tried

document.forms["entry"].selChoices.style.visibility = "hidden"

but that does not work.
What is the property for controlling visible/hidden?

premshree
01-11-2004, 07:25 PM
You need to place the code for the <select> in a layer; then you can set the visibility of the layer to hidden:



<td colspan="3" rowspan="3" valign="top"><font face="Courier" size="4">
<div id="yourID" style="display:block">
<select name="selChoices" size="10" id="selChoices">
</select>
</div>
<script language="JavaScript" type="text/javascript">
document.getElementByID("yourID").style.display = "none";
</script>
</font></td>

glenngv
01-12-2004, 07:49 AM
typo:

document.getElementByID("yourID").style.display = "none";

it should be a small "d".



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum