Results 1 to 2 of 2

Thread: Using JS

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Using JS

    I want a table to be displayed depending on whether a check box is marked or not. I am doing this by the onClick event.

    Code:
    <input type = checkbox name = "temp" size = 4 maxlength = 4 value = "90" onClick=getTable()>
    But how do I write the code? Any suggestions for the JavaScript code? Can I include the request.querystring("temp") in the JavaScript function?

    Code:
    <script language=javascript>
    function getTable() 
    {
     ???	
    }	
    </script>

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Add an ID="tempid" in that, and put in this code:

    if (tempid.checked == true) {
    [tableID].style.visibility = "visible";
    }
    if (tempid.checked == false) {
    [tableID].style.visibility = "hidden";
    }

    The [tableID] is the ID of the table you want to show. Put a Style tag in that table:

    STYLE="visibility:hidden;"

    You should be all set.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

Posting Permissions

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



Click Here to Expand Forum to Full Width