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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hiding a control in JavaScript in pagelode

    Hi,

    I have two DropDownList boxes and one button in my page, I want to disply ListBoxes whenever I click the button. I want to hide these controls when the page is loading. How to do this.

    Regards,
    Chakravarthy.v

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Code:
    <html>
    <head>
    <script type="text/javascript">
    function showListBoxes(){
      document.getElementById('list1').style.display='inline';
      document.getElementById('list2').style.display='inline';
    }
    </script>
    </head>
    <body>
    <form>
    <select name="list1" id="list1" style="display:none">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    </select>
    <select name="list2" id="list2" style="display:none">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    </select>
    <input type="button" value="Show" onclick="showListBoxes()" />
    </form>
    </body>
    </html>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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