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 Answer