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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:00:54+00:00 2026-06-07T02:00:54+00:00

I found the solution to reset radiobuttons. This next example works well for 4

  • 0

I found the solution to reset radiobuttons.

This next example works well for 4 radiogroups:

<script type="text/javascript">
function uncheckRadio()
{   
    for(x=0; x<document.QuizForm.Q01.length; x++){document.QuizForm.Q01[x].checked = false;}
    for(x=0; x<document.QuizForm.Q02.length; x++){document.QuizForm.Q02[x].checked = false;}
    for(x=0; x<document.QuizForm.Q03.length; x++){document.QuizForm.Q03[x].checked = false;}
    for(x=0; x<document.QuizForm.Q04.length; x++){document.QuizForm.Q04[x].checked = false;}
}   

</script>

But now I want to reset 80 radiogroups in one single (multiple choice) form by applying a nested loop to iterate from 01 to 80.

Tried several ways to use nested loops, but somehow I cannot find a way to get the Q01, Q02 etc. iteration to work…

Many thanks

  • 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-07T02:00:55+00:00Added an answer on June 7, 2026 at 2:00 am

    In the browser that supports the standards, you could use querySelectorAll, if you’re sure that there are no other radio with name attributes that starts with “Q”:

    var radios = document.QuizForm.querySelectorAll("input[type=radio][name^=Q]:checked");
    
    for (var l = radios.length; l > 0;)
      radios[--l].checked = false;
    

    Otherwise you can use the square bracket notation:

    var elements = document.QuizForm.elements;
    var prefix;
    
    for (var l = 80; l > 1; l--) {
      prefix = l < 10 ? "Q0" : "Q";
      elements[prefix + l].checked = false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edited: SOLUTION FOUND. This is strange and not the best solution, but I just
I found the solution for this question in C# , but I can't translate
Edited to Add * I haven't found a solution for this one yet, can
I edited this question after i found a solution... i need to understand why
I know people asked this before and I found this solution: for (UIView *subview
I found this great jquery bubble script online - http://jqueryfordesigners.com/coda-popup-bubbles/ - and I want
Seems, it's common task, but I haven't found solution. I need to calculate number
Update Solution Found See Bottom of post if interested Seems simple enough and for
[edit] Found the solution. Reinstall EVERYTHING - xcode, mono, monodevelop and monotouch. Now it
Following the solution found at Can I access session state from an HTTPModule? ,

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.