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 8490445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:07:17+00:00 2026-06-10T22:07:17+00:00

I explained my problem, I have an overlay that I used to delete the

  • 0

I explained my problem, I have an overlay that I used to delete the categories. I add an action to let you choose where to go when the job categories will be deleted.

For this, I use checkbox and I add a javascript function “open” a form when the checkbox is click,
here is an exemple box close:

First box

here is an exemple box open:

second box

My html code:

  <form method="get">
    <input type="radio" name="cat_action" value="delete" /> Delete all tracks<br />
    <input type="radio" name="cat_action" value="move" onclick="showMe('div_<?php echo $value->ID ?>', this)" /> Move tracks<br />

    <div id="div_<?php echo $value->ID ?>" style="display:none">
    <label for="track">Move tracks to: </label>
    <select id="cate" name="cate">
    <?php foreach (arrayToObject($startup->getCat()) as $value) { ?>
      <option value="<?php echo $value->ID ?>"><?php echo $value->post_title ?></option>
    <?php } ?>  
    </select> <br />        
    </div><br />    

    <button type="submit"> OK </button>
    <button type="button" class="close"> Cancel </button>
  </form>

My javascript code:

<script type="text/javascript">
function showMe (it, box) {
var vis = (box.checked) ? "block" : "none";
document.getElementById(it).style.display = vis;
}
</script>

My problem:
When the checkbox opens the list, it does not close when I click on first checkbox.
I just want to create a function that closes the second checkbox.

You can try it here: http://jsbin.com/usituv/3/edit

  • 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-10T22:07:19+00:00Added an answer on June 10, 2026 at 10:07 pm

    The problem is due to the fact that you don’t do anything on the “Delete” option selection – only on “move” selection. Below is how I updated your script to work properly (provided I understand what you’re after). Specifically note the changes:

    • Adding id attribute to the move radio button
    • Adding onclick handler to the delete radio button
    • Changing javascript function to accept only one parameter
    • Using getElementById function to retrieve the reference to the move radio button inside the javascript function.

    Also note that it would be better to separate all your javascript into a separate file, including assigning the onclick handlers. However I’m simply fixing your problem at hand here.

    <form method="get">
        <input type="radio" name="cat_action" value="delete"
               onclick="showMe('div_1')"/> Delete all tracks<br />
        <input type="radio" name="cat_action" value="move"
               onclick="showMe('div_1')" id="move"/> Move tracks<br />
    
        <div id="div_1" style="display:none">
            <label for="paypal">Move tracks to: </label>
            <select id="cate" name="cate">
                <option value="dubstep">Dubstep</option>
                <option value="breakbeat">Breakbeat</option>
                <option value="dnb">D'n'B</option>
            </select> 
        </div>
    
        <br />
    
        <button type="submit"> OK </button>
        <button type="button" class="close"> Cancel </button>
    </form>
    
    <script type="text/javascript">
        function showMe (it) {
            var box = document.getElementById("move");
            var vis = (box.checked) ? "block" : "none";
            document.getElementById(it).style.display = vis;
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem adding arraylist to list view, will explain about my problem here..
I have a problem and I will try to explain the issue: I have
I have a problem that is kind of difficult to explain. What I would
I have a problem that is a little hard to explain. I am building
I have a problem with Facebook. Let me explain what I'm trying to do.
I have overlay inside HTML element and inside that overlay I have element that
I have explained the problem below this code <div id='content'> <div id='help'> blah blah
the problem i have is that i have multiple nested master pages: level 1
here's my problem: I have an SQL query that makes 4 calls to a
The Problem I have a table that's about 2 million rows (at 115 MB)

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.