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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:41:22+00:00 2026-05-26T20:41:22+00:00

There are two problems I am having with this script. 1) I want the

  • 0

There are two problems I am having with this script. 1) I want the invisble question to shrink to height 0 (so that the questions are not jumping up and down). 2) When the question becomes ‘invisible’, I want the bullet group to be *un*checked.

To complicate things a little, I cannot use jQuery or other libraries, it must be done with JavaScript.

<style type="text/css">
    #Q2{visibility:hidden;}
    #Q3{visibility:hidden;}
</style>
<script type="text/javascript">
function yes(){
    document.getElementById('group2').style.visibility = "visible";
    document.getElementById('group3').style.visibility = "collapse";
}
function no(){
    document.getElementById('group2').style.visibility = "collapse";
    document.getElementById('group3').style.visibility = "visible";
} 
</script> 

</head>
<body>

<form name="test">
    <p>Yes or No?
    <input type="radio" name="buy" value="yes" onClick="yes()" />Yes 
    <input type="radio" name="buy" value="no" onClick="no()"/> No

    <p id="group2">Yes or No?
    <input type="radio" name="go" value="yes" />Yes 
    <input type="radio" name="go" value="no" /> No</p>

    <p id="group3">Yes or No?
    <input type="radio" name="stop" value="yes" />Yes 
    <input type="radio" name="stop" value="no"  /> No</p>   
</form>
  • 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-26T20:41:23+00:00Added an answer on May 26, 2026 at 8:41 pm

    Try setting display property instead of visibility, the clearRadioButtonValue will take of resetting the radio button group value to unchecked

    function yes(){
      document.getElementById('group2').style.display = "";
      document.getElementById('group3').style.display = "none";
      clearRadioButtonValue();
    }
    function no(){
      document.getElementById('group2').style.display = "none";
      document.getElementById('group3').style.display = "";
      clearRadioButtonValue();
    }
    function clearRadioButtonValue()
    {
      var group2 = document.forms.test.go;
      var group3 = document.forms.test.stop;   
      for(var i=0;i<group2.length;i++){group2[i].checked=false;}
      for(var i=0;i<group3.length;i++){group3[i].checked=false;}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some localization problems in my webpage. There are basically two problems (that
I have two simple script that enables/disables Cisco AnyConnect when I don't want it
Just like the title says I am having problems combining two classes. Altough this
There are two popular naming conventions: vc90/win64/debug/foo.dll foo-vc90-win64-debug.dll Please discuss the problems/benefits associated with
I am having a strange problem. There are two ajax calls in the code.
Git newbie here. Is there a way to synchronize two repositories, so that the
I'm making a script that parses an xml and outputs a html form. This
I am having problems with jQuery validation of a form. This is my javascript
I'm having problems adding a XHR request to query JSON to my script, I
I've written a PHP script that takes in two CSV files, processes them and

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.