How can I hide a select element in Netscape


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How can I hide a select element in Netscape

  1. #1
    Hari Somaskanthan Guest

    How can I hide a select element in Netscape


    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


  2. #2
    Frederiek Guest

    Re: How can I hide a select element in Netscape


    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
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center