Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7943465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:16:55+00:00 2026-06-04T00:16:55+00:00

so i am trying to make dynamic checkboxs that will show/hide certain content when

  • 0

so i am trying to make dynamic checkboxs that will show/hide certain content when clicked. I have this but cannot get it to work properly:

<html> 
<head> 
    <title>Checkbox Event Handler</title> 
    <style type="text/css"> 
        #myGroup {visibility:hidden} 
    </style> 
    <script type="text/javascript"> 
        function toggle(chkbox, group) { 
            var visSetting = (chkbox.checked) ? "visible" : "hidden"; 
            document.getElementById(group).style.visibility = visSetting; 
        } 
        function swap(radBtn, group) { 
            var modemsVisSetting = (group == "modems") ? ((radBtn.checked) ? "" : "none") : "none"; 
            document.getElementById("modems").style.display = modemsVisSetting; 
        } 
    </script>
    <?php require_once("/var/www/html/exercise/Task/functions.php"); ?>
</head> 
<body> 
    <?php
        $seqA[]="AAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBB";
        $seqA[]="BBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCDDDDDDDDDD0";
        $seqA[]="CCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD";
    ?>
    <form>
    <?php
        $i=o;
        foreach($seqA as $seq){
    ?>
            <input type="checkbox" name="monitor"onclick="toggle(this, 'myGroup')" />show results
            <span id="myGroup">
     <?php
            $score=rawtransform(950);
            $truecol= getcolor($score,220);
            colorSequence($seq,5/*hit*/,$truecol,4);
        }
      ?>
            </span>
    </form>
</body>
</html>

it opens the first string in $seqA normally and works fine however the second checkbox is within the first string ?
Im sure ive done something very stupid, but im new to programming.
Anyone help please ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:16:56+00:00Added an answer on June 4, 2026 at 12:16 am

    The problem I see is that in each foreach loop iteration you add element span with the same id attribute. Set unique IDs, change your JavaScript toggle function to address specified span and it will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to make a JDialog that will show the user a dynamic message
Im trying to make a custom view that will have a dynamic number of
Im trying to make dynamic column list that will be 4 columns total (PHP).
I'm trying to make a dynamic fb-like button that gets the page location but
I'm trying to make a dynamic regex that matches a person's name. It works
I'm trying to make a dynamic array in C# but I get an annoying
I'm trying to make a dynamic PDF form using Adobe LiveCycle designer and have
I am trying to make a dynamic function but i am having trouble because
I'm trying to make a dynamic sales report that allows users to remove customer
I'm trying to make a little dynamic quote rotator that overlays text on an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.