I have multiple html checkboxes that all have different names.
What I have to do is when it is checked it should disable some radio button that has a different name.
I know it can be simply done using jquery.
Any help...with a simple example..thanks
I have multiple html checkboxes that all have different names.
What I have to do is when it is checked it should disable some radio button that has a different name.
I know it can be simply done using jquery.
Any help...with a simple example..thanks
.....
$("input[type=checkbox]").click(function(){
if($(this).is(":checked")) {
$("input[type=radio]").attr('disabled', 'disabled');
}
else
{
$("input[type=radio]").removeAttr('disabled');
}
});
$("input[name=theName]:checkbox").click(function() {
if($(this).is(":checked")) {
$("input[name=radioName]:radio").attr("disabled", "disabled");
} else {
$("input[name=radioName]:radio").removeAttr("disabled");
}
});
Shorter way:
$("input[name=theName]:checkbox").click(function() {
$("input[name=radioName]:radio").attr("disabled", $(this).is(":checked"));
});