Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2003
    Location
    Bahamas
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need to hide select box ASAP

    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?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mumbai, India
    Posts
    218
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to place the code for the <select> in a layer; then you can set the visibility of the layer to hidden:

    Code:
    <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>

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    typo:

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

    it should be a small "d".


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •