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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:49:55+00:00 2026-05-10T15:49:55+00:00

For the following HTML: <form name="myForm"> <label>One<input name="area" type="radio" value="S" /></label> <label>Two<input name="area" type="radio"

  • 0

For the following HTML:

<form name="myForm">     <label>One<input  name="area"  type="radio" value="S"  /></label>     <label>Two<input name="area"   type="radio" value="R" /></label>     <label>Three<input name="area"   type="radio" value="O" /></label>     <label>Four<input name="area" type="radio" value="U" /></label> </form> 

Changing from the following JavaScript code:

$(function() {      var myForm = document.myForm;      var radios = myForm.area;            // Loop through radio buttons      for (var i=0; i<radios.length; i++) {         if (radios[i].value == "S") {             radios[i].checked = true;   // Selected when form displays             radioClicks();   // Execute the function, initial setup         }         radios[i].onclick = radioClicks;  // Assign to run when clicked      }    }); 

Thanks

EDIT: The response I selected answers the question I asked, however I like the answer that uses bind() because it also shows how to distinguish the group of radio buttons

  • 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. 2026-05-10T15:49:56+00:00Added an answer on May 10, 2026 at 3:49 pm
    $( function() {     $('input:radio')         .click(radioClicks)         .filter('[value='S']')         .attr('checked', 'checked'); }); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following HTML form: <form id=myform> Company: <input type=text name=Company value=ACME, INC./> First
When you do the following in an HTML form: <input name=one[] value=foo /> <input
Suppose I have the following HTML: <form id=myform> <input type='checkbox' name='foo[]'/> Check 1<br/> <input
Suppose the following HTML div container <div id=container> <form> <div> <label class=error>Name</label> <input type=text
I have an html form that has the following structure: <input type=text name=title />
I have following HTML with two elements having the same name <input type=hidden name=
I have the following html: <body> <form action=site1> <input type=image name=submit border=0 src=images/front/search_travel.png alt=
I have the following html: <html> <body> <form runat=server> Name: <input type=text name=name />
Please consider the following HTML: <input type='text' id='name'/> <option id='option'> <select value='1'>hi</select> <select value='2'>bye</select>
I have created one html form with following fields: Name (Text Box) Email (Text

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.