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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:08:51+00:00 2026-06-04T09:08:51+00:00

This is my first time to post my query on stackoverflow. I have created

  • 0

This is my first time to post my query on stackoverflow. I have created one form and in the form have a drop down of few cities. On drop down change related group of radio button get displayed. Every radio button has same name as “preferred_location”.

On any selection of radio button i want to mark one checkbox as CHECKED. I have tried lots of option available on net and they sound simple and work in demo but not in my code. To review i have posted my code sample here below:

Jquery script

$(document).ready(function(){
        $("#address input[name*='redio']").click(function() {
            $('#note').removeClass("inactive").addClass("active");
        });  
    });

To display radio button group on change of dropdown i am using below code

if(valuecheckdrop == "Coimbatore"){ 
   $("#address").html("<h2>Select date of info session:</h2>",
       "<p>",
       "<input type='radio' name='preferred_location' value='Radio1' class='redio' /> Radio1",
       "</p>",
       "<p class='sub'>address</p>",
       "<p class='option'>",
           "<input type='radio' name='preferred_location' value='Radio2'  class='redio' />Radio2",
       "</p>",
       "<p class='sub'>Address2</p>");
}

On drop down change group of radio button get displayed but nothing is happen on click of radio button.

Is it because i am calling radio button on change event of drop down? Any help will be appreciated.

  • 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-04T09:08:52+00:00Added an answer on June 4, 2026 at 9:08 am
       $(document).ready(function () {
                    $("#graduate").change(function () {
                        var valuecheckdrop = $("#graduate").val();
                         $('#cbTest').prop('checked', false);
                        if (valuecheckdrop == "") {
                            $("#note").show();
    
                            //$("#address").removeClass("addresson").addClass("addressoff");
                            //Or
                            $("#address").html('');
    
                        } else {
                            $("#note").hide();
    
                            //$("#address").removeClass("addressoff").addClass('addresson');
    
                            switch (valuecheckdrop) {
                                case 'Bangalore':
                                    $("#address").html("<h2>Select date of info session:</h2><p><input type='radio' name='preferred_location' value='June 2, 2012, Sat 11am - 1pm The Presidency, No. 1 St Marks Road' class='redio' /> June 2, 2012 <span>(Sat 11am - 1pm)</span></p><p class='sub'>The Presidency, No. 1 St Marks Road</p><p class='option'><input type='radio' name='preferred_location' value='June 2, 2012, Sat 3pm - 5pm Manipal Center, Dickenson Road' class='redio' /> June 2, 2012 <span>(Sat 3pm - 5pm)</span></p><p class='sub'>Manipal Center, Dickenson Road</p><p class='option'><input type='radio' name='preferred_location' value='June 3, 2012, Sun 12noon - 5pm Taj Gateway Hotel, Residency Road' class='redio' />June 3, 2012 <span>(Sun 12noon - 5pm)</span></p><p class='sub'>Taj Gateway Hotel, Residency Road</p><p class='option'><input type='radio' name='preferred_location' value='June 4, 2012, Mon 11am - 1pm S&B Towers, MG Road' class='redio' />June 4, 2012 <span>(Mon 11am - 1pm)</span></p><p class='sub'>S&B Towers, MG Road</p>");
                                    break;
                                case 'Chandigarh':
                                    $("#address").html("<h2>Select date of info session:</h2><p><input type='radio' name='preferred_location' value='May 26, 2012, Sat 10:30am - 5:30pm The Park Hote, Anna Salai' class='redio' /> May 26, 2012 <span>(Sat 10:30am - 5:30pm)</span></p><p class='sub'>The Park Hote, Anna Salai</p><p class='option'><input type='radio' name='preferred_location' value='May 28, 2012, Mon 1pm - 3pm No. 16, Nungambakkam' class='redio' />May 28, 2012<span>(Mon 1pm - 3pm)</span></p><p class='sub'>No. 16, Nungambakkam</p><p class='option'><input type='radio' name='preferred_location' value='May 28, 2012, Mon 10am - 12noon Sindur Shopping Centre, Anna Nagar' class='redio' /> May 28, 2012 <span>(Mon 10am - 12noon)</span></p><p class='sub'>Sindur Shopping Centre, Anna Nagar</p>");
                                    break;
                            }
    
                            //$("#address").find(':radio:first').prop('checked', true);
                        }
                    });
    
                    $("#graduate").trigger('change');
    
                    $("#address").find(':radio').live('click', function (e) {
                        $('#cbTest').prop('checked', $("#address").find(':radio:checked').length > 0);
                    });
                });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time here so I hope I post this question at
this is my first post on this website, but I'm all the time getting
this is my first time posting here, I have a question which I have
This is my first time on StackOverflow though I read Coding Horror quite often.
This is my first time creating a PHP form that will run a MySQL
This is the first time I'm using jqgrid. I have confused in how to
First time using wordpress query so not sure how to handle this problem. I
First time poster, long time lurker :) I have a form setup that posts
First post time, I've been playing around with MVC abit... I have a view
I have this weird situation that i have encountered for the first time and

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.