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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:17:50+00:00 2026-06-12T10:17:50+00:00

I have the following for set-up: <form action="?" method="post" name="contactform"> <div class="question"> <p><span><input type="radio"

  • 0

I have the following for set-up:

<form action="?" method="post" name="contactform">

<div class="question">
    <p><span><input type="radio" name="answer" value="Yes" onclick="showHide('one')"/></span> Yes</p>
</div>
<div id="one" class="answers" style="display:none">
    <p><input type="radio" name="answerdetail" value="Reason One" /> Reason One</p>
    <p><input type="radio" name="answerdetail" value="Reason Two" /> Reason Two</p>
    <p><input type="radio" name="answerdetail" value="Reason Three" /> Reason Three</p>
</div><!-- end answers -->

<div class="question">
    <p><span><input type="radio" name="answer" value="No" onclick="showHide('two')"/></span> No</p>
</div>
<div id="two" class="answers" style="display:none">
    <p><input type="radio" name="answerdetail" value="Reason One" /> Reason One</p>
    <p><input type="radio" name="answerdetail" value="Reason Two" /> Reason Two</p>
    <p><input type="radio" name="answerdetail" value="Reason Three" /> Reason Three</p>
    <p><input type="radio" name="answerdetail" value="Reason Four" /> Reason Four</p>
</div><!-- end answers -->

<div class="question">
    <p><span><input type="radio" name="answer" value="Not sure" /></span> Not sure</p>
</div>

When you first see the form there are only 3 check boxes visible (Yes, No, Not Sure). When you click ‘Yes’, the sub checkboxes for ‘Yes’ appear and if you click ‘No’, the sub checkboxes for ‘No’ appear.

I would like to know if it is possible to only show one set of sub checkboxes at a time?

I.e. if somebody checks ‘Yes’ the sub checkboxes for ‘Yes’ appear. If they then change their mind and click ‘No’ the sub checkboxes for ‘Yes’ disappear and the sub checkboxes for ‘No’ appear (i.e. only one set of sub checkboxes is ever visible at any one time).

I hope this makes sense.

Any help would be greatly appreciated!

  • 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-12T10:17:53+00:00Added an answer on June 12, 2026 at 10:17 am

    jQuery has several built in methods which should be useful for this. You can use .hide()/.show() to toggle the visibility of the elements. You can target the correct answer section using .next(). Furthermore, to handle the ‘change’ event, you can use .change(), which will fire the handler every time the user selects a different option:

    $(document).ready(function() {
        $('input[name="answer"]').change(function() {
            $(".answers").hide();
            $('input[name="answer"]:checked')
                .closest(".question")
                .next(".answers")
                .show();
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following form in cakephp: <div class=quickcontactDisplay> <?php echo $form->create('Enquiry',array('action'=>'add','class'=>'quickcontact')); echo $form->hidden('visitor_id',
Hi, I have the following in my view : <form id=list_ad method=get class=adListFilter action=<%=Url.Action(List,
Hi there I have an error when I submit the following form: <div id="tabs">
I Have following in my struts.xml file <action name=ProductVerification class=com.frontend.ProductVerification> <result name=success>/jsp/product_verification.jsp</result> <result name=input>/jsp/product_verification.jsp</result>
I am using the following form to take input and then set an action
I have 2 forms set up. In the first form I have the following
I have set up a datepicker in a form using the following js: $(#Expiry).datepicker({
I have the swiss data set provided by R, which has the following form:
I have the following function set up to sequentially fade in divs (with class
I have a form "test.cfm" It passes values to an action page "testAction.cfm"! test.cfm

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.