Hiding a table in JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • F159753
    New Member
    • Apr 2008
    • 31

    #1

    Hiding a table in JavaScript

    Hello,

    what would be the code if I want to hide or show a table included some fields in Javascript?

    Thanks
    F
  • danp129
    Recognized Expert Contributor
    • Jul 2006
    • 323

    #2
    Originally posted by F159753
    Hello,

    what would be the code if I want to hide or show a table included some fields in Javascript?

    Thanks
    F
    put the table in a div and change the visibility of the div.


    [CODE=html]<script language="javas cript">
    function ToggleTable(div id) {
    cdiv=document.g etElementById(d ivid);
    if (cdiv.style.dis play=='') {
    cdiv.style.disp lay='none';
    } else {
    cdiv.style.disp lay='';
    }
    }
    </script>
    <input type=button value="Toggle" onclick="Toggle Table('results' );">
    <div id="results">
    <table>
    <tr><th>a</th><th>b</th></tr>
    <tr><td>1</td><td>2</td></tr>
    </table>
    </div>[/CODE]

    Comment

    • F159753
      New Member
      • Apr 2008
      • 31

      #3
      That worked, Thank you.

      Now I have a dropdown in a form. How should I know what is the Value of that in ASP?

      Thanks

      Comment

      Working...