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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:30:27+00:00 2026-05-31T20:30:27+00:00

My page has about 25 radio button groups. When a radio button is selected

  • 0

My page has about 25 radio button groups. When a radio button is selected in a group, I want to perform an action Specific to that group, and so need the NAME attrib of the radio group.

  • 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-31T20:30:28+00:00Added an answer on May 31, 2026 at 8:30 pm

    Take this HTML for example :

    <div id="stackExchange">
      <input type="radio" name="sofu_group" value="Stack Overflow">
      <input type="radio" name="sofu_group" value="Meta Stack Overflow">
      <input type="radio" name="sofu_group" value="Server Fault">
      <input type="radio" name="sofu_group" value="Super User">
    </div>
    <!-- In no particular order - don't want to start a flame war ;) -->
    

    If you wanted to deduce what group the clicked radio button belongs to you could use something like this :

    // jQuery ver 1.7+
    $("#stackExchange input:radio").on('click',function(){   
      var groupName = $(this).attr('name');
      var groupElements = $(this).parent().find(":radio[name='"+groupName+"']");
    });
    

    Lets see whats going on here :

    • $("#stackExchange input:radio") – this selector will find us all of the input radio elements that are decendants of the #stackExchange element using the :radio selector. (Link to docs).
    • $(this).attr('name') – here is where we extract the name attribute of the selected radio element. (In our example – this becomes sofu_group).
    • $(this).parent() – In this case the variable $(this) refers to the radio element that was clicked – so we are selecting its parent – the #stackExchange element.
    • parent().find(":radio[name='"+groupName+"']") – this line will find all of the radio buttons held within the element that have a name attribute set to ‘sofu_group’.

    In the example – the variable $(this) refers to the radio element that was clicked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that has about 20 divs one under the other on
I have gridview1 on sample.asp page. It has about 15 rows. What i want
I have two JSP pages that are just about identical. Each page has an
Page has menu items that would replace a 'div id=foo_(current menu item)' with 'div
I want to disable Javascript once a page has already loaded. Why? Because I
Problem: to show that a Not-SO-page has been discussed in SO when you at
I have a php page that has a few HTML questions on it, each
I want to parse a web page and find specific patterns using regex on
My website has about 20 thousand product images. Google Page Speed tells me they
One of my pages has about 5 jQuery AJAX calls that fire off as

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.