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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:33:56+00:00 2026-05-15T22:33:56+00:00

I load a page with ajax/jquery, inside it i have some radio one of

  • 0

I load a page with ajax/jquery, inside it i have some radio one of this may be checked, I’m trying to get value of checked radio, I can not get it on page loading but after it’s loaded if a check another radio I can get value. here is example code:

html:

<form id="form1">
<input type="radio" name="a" value="10"> a
<input type="radio" name="a" value="15"> b
<input type="radio" name="a" value="19"> c
</form>

jquery:

$(function(){
var ch=$("input[name='a']:radio:checked");
    $.each(ch, function()
           {
               var chv=$(this).val();
               alert(chv);
           });

$(":radio[name='a']").click(function(){
    var ch=$("input[name='a']:radio:checked");
    $.each(ch, function()
           {
               var chv=$(this).val();
               alert(chv);
           });
});
});

Thanks in advance.
ciao
h

  • 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-15T22:33:57+00:00Added an answer on May 15, 2026 at 10:33 pm

    I think the problem your running in to is that you’re not putting the code in a document.ready() wrapper. You could try doing it like this:

    $(document).ready(function(){
     // get value if clicked
     $("input:radio[name='a']").click(function(){
       var value = $(this).val();
       alert(value);
     });
    
     // get value on load
     var valueOnLoad = $("input[name='a']:radio:checked").val();
     alert(valueOnLoad);
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This relates to my previous post: jQuery .load Method causing page refresh AJAX I
Im using jquery to call a page via ajax. I have some jquery functions
I am using jQuery to load a page by AJAX using $.ajax (suppose test.html).
I've just starting learning jQuery and AJAX. I'm able to load a local page
I have a page where I load a table of information using ajax. Once
I've tried to load Disqus with ajax in my page, i'll explain. I have
I'm trying to load page and then remove some elements in it. While doing
I have a website that uses ajax jquery and colorbox. Inside the div #content
On an Aspx page, I have this markup (setup for a jQuery UI dialog):
OK here goes, I'm using jQuery ajax to load post from inside a slider.

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.