SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Want to make a particular check box show up when another is checked

    I hope that subject title made sense, but I am looking for a way, and I am not sure if it is ASP or Javascript, but I only want a particular check box to show up if another particular checkbox is checked.

    So I have like 5 options, but a "hidden" 6th option. If option #1 is checked, I want option 6 to show up. But if option 2 - 5 is checked, I don't want option 6 to show.

    How could I do this? Showing code would be appreciated or a site that could help me.

    Thanks
    Bryan

  2. #2
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, how about an easier option

    I can wrap that particular element inside a div, then have a script to show/hide the div depending on the box checked.

    So if the box containing the value of 598 is checked, show <div id="webinar">, else, hide that div.

    How could I do this

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Code:
    <script type="text/javascript">
    function showWebinar(cbox) {
      var webin = document.getElementById("webinar");
      if (cbox.checked) {
         webin.style.display = 'block';
      }
       else
      {
         webin.style.display = 'none';
      }
    }
    </script>
    HTML Code:
    <input type="checkbox" name="theBox" value="598" onclick="showWebinar(this);" />

  4. #4
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Vinnie


Bookmarks

Posting Permissions

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