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

  • Home
  • SEARCH
  • 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 938961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:42:53+00:00 2026-05-15T21:42:53+00:00

UPDATE: The problem is more complex. Looks like it involves accordion header not passing

  • 0

UPDATE:
The problem is more complex. Looks like it involves accordion header not passing .click events correctly, and has nothing to do with :checked selector. All of this example work fine in a test file.

Please see Radio input in header of accordion problem ?BUG

I have a form with several radio elements, each names “rx” (where x is 1..3), .buttonset() applied.
with

e.g id=3

alert ($('input:radio[name=r'+id+']').val());
//returns value of the first radio in the set

alert ($('input:radio[name=r'+id+']:checked').val());
//returns 'undefined', even one of the radios is checked.

and I’ve tried both :checked')[0], :checked').get(0), :checked').attr('id')

I wonder why the first method returns a value… Does it have anything to do with .buttonset adding classes/element??

Any advice is appreciated!

PS. $(‘input:radio[name=r’+id+’]’).get(0)
returns [object HTMLInputElement], I guess the way its supposed to. But this object has no .html() or .val() methods. $(‘input:radio[name=r’+id+’]:checked’).get(0) is still ‘undefined’.

PPS. forcing visibility for ui-helper-hidden-accessible
buttonset does not change “checked” for the original radio elements.
I guess I can use .ui-state-active to check active radio instead… Any better way?

  • 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-15T21:42:54+00:00Added an answer on May 15, 2026 at 9:42 pm

    The reason it doesn’t return a value is because when you use the :checked selector if the radio is not selected it won’t be part of the resultset. Example:

    <input type="radio" name="r1" value="1" checked="checked" />
    <input type="radio" name="r2" value="2" />
    

    Now:

    alert($('input:radio[name=r1]').val()); // alerts 1
    alert($('input:radio[name=r1]:checked').val()); // alerts 1
    alert($('input:radio[name=r2]').val()); // alerts 2
    alert($('input:radio[name=r2]:checked').val()); // alerts undefined as the button is not selected
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE It looks like this problem has been quietly fixed in iOS 4.3. Up
Update: I've fixed up my referencing below, and my problem is now more specific.
Update: After some more reading I see that this problem is totally general, you
I found some problem. When i running apc_store and more times update a page
Update II Problem Solved but Why? This has been the biggest headache ever. My
This is a problem I encounter frequently in working with more complex systems and
UPDATE: Problem located in my related question - Nokogiri performance problem I am having
I am having a binding update problem with my ComboBox. My ComboBox's ItemSource is
UPDATE: First problem solved, second one described at the bottom of this post. UPDATE2:
Update : The problem appears to have been corrupt DLLs somewhere in my PHP

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.