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

  • SEARCH
  • Home
  • 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 7446557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:20:37+00:00 2026-05-29T12:20:37+00:00

PHP: <input type=’checkbox’ onChange=’DoTheSwitch(1);’><div id=’Hide1′>Hide</div> 1 <input type=’checkbox’ onChange=’DoTheSwitch(2);’><div id=’Hide2′>Hide</div> 2 <input type=’checkbox’ onChange=’DoTheSwitch(3);’><div

  • 0

PHP:

<input type='checkbox' onChange='DoTheSwitch(1);'><div id='Hide1'>Hide</div> 1
<input type='checkbox' onChange='DoTheSwitch(2);'><div id='Hide2'>Hide</div> 2
<input type='checkbox' onChange='DoTheSwitch(3);'><div id='Hide3'>Hide</div> 3
<input type='checkbox' onChange='DoTheSwitch(4);'><div id='Hide4'>Hide</div> 4
<input type='checkbox' onChange='DoTheSwitch(5);'><div id='Hide5'>Hide</div> 5

JavaScript:

function DoTheSwitch(a){
    var h = getEl("Hide"+a+"").innerHTML;
    switch(h){
        case "Hide":
            getEl("Hide"+a+"").innerHTML = "Show";
            $('input[id^="Hide"]').click(function(){
                $('#HideAB'+$(this).val()).hide();
            });
            break;
        case "Show":
            getEl("Hide"+a+"").innerHTML = "Hide";
            $('input[id^="Hide"]').click(function(){
                $('#HideAB'+$(this).val()).show();
            });
            break;
    }
}

Output (Many Small Dots on Map):

<div id='HideAB".$Stat."' style='display:block;'></div>

Those “HideAB” will have a value of 1, 2, 3, 4, 5 or 6 based on what I pulled from Database.

What I’m trying to do (sleepyhead at the moment) is whenever a user select a check box “1”, I want to hide all the HideAB with a value of 1, and uncheck to show, so forth. How do I fix that in Javascript/JQuery part?

  • 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-05-29T12:20:38+00:00Added an answer on May 29, 2026 at 12:20 pm

    Id should be unique across the page, that could be what’s causing troubles. Try using a class instead if you have to handle several elements together.

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

Sidebar

Related Questions

I am trying to click an input type checkbox.. when clicked an AJAX call
i have the following jquery code: $(document).ready(function() { $('.restrictiveOptions input[type!=checkbox], .restrictiveOptions select').change(function() { //
<form method = post action = <?php echo $_SERVER['PHP_SELF']; ?> /> Username:<input type =
main.php: <SCRIPT type=text/javascript> $(#btnSubmit).click(function () { alert(What will i put here!); }); </SCRIPT> <input
I have a problem in PHP. I am using <input type=file> to get the
<input type = 'text' name = 'name_'<?php echo $rownum'?> id = <?php echo $category_id
According to php manual nor php://input neither $HTTP_RAW_POST_DATA work with multipart/form-data POST-requests. php://input allows
I am using codeigniter framework. where should i sanitize PHP input - controller or
I have a complex input form within a PHP based web application. To structure
We have a PHP/MYSQL application that collects user input, including special characters like ø,ü,ñ,

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.