Click to See Complete Forum and Search --> : How can I hide a select element in Netscape


Hari Somaskanthan
11-21-2000, 08:22 PM
Hi,

I have created a menu in my web page. Some of the form elements (i.e. select)
are top of the drop down menu. So, I set the visibility to hidden for those
elements while displaying the drop down menu. It works fine in IE4. But I
don't know how to hide those controls in Netscape.....

Here is the sample code

<Script>
function HideSel()
{
document.all.cboSMDF.style.visibility = "hidden";
}
</SCRIPT>

<BODY>

<form name="frm">
<select name="cboSMDF" size="1">
<option>option1</option>
</select>
<input type=button Onclick="HideSel()" value="Hide">
</form>


Thanks for your help

Hari Somaskanthan

Frederiek
11-22-2000, 08:19 AM
You can't hide form elements in NS like you did for IE, but you could try
to put the select element in a layer and set the visibilty of that layer
from a call in the button click.
It might be that you have to give the select it's own form tag within the
layer, thus having two forms, to be able to have the button click act. Cause
if I remember correctly, NS doesn't like having form elements spread in different
object elements, eg one piece in one layer and another in another layer.
You'll have to try for yourself.

Mind you that you'll have to set the visibility of the layer, not the select
element itself.

cya
Frederiek


"Hari Somaskanthan" <haris1@avaya.com> wrote:
>
>Hi,
>
>I have created a menu in my web page. Some of the form elements (i.e. select)
>are top of the drop down menu. So, I set the visibility to hidden for those
>elements while displaying the drop down menu. It works fine in IE4. But
I
>don't know how to hide those controls in Netscape.....
>
>Here is the sample code
>
><Script>
>function HideSel()
>{
>document.all.cboSMDF.style.visibility = "hidden";
>}
></SCRIPT>
>
><BODY>
>
><form name="frm">
><select name="cboSMDF" size="1">
> <option>option1</option>
></select>
><input type=button Onclick="HideSel()" value="Hide">
></form>
>
>
>Thanks for your help
>
>Hari Somaskanthan
>