Answer the question
In order to leave comments, you need to log in
How to make disable only for a certain radio?
Hello everyone, tell me how to make the checkbox (id="parts_clear") inactive if radio id="image_upload" is selected, and if id="parts_upload" is selected, then the checkbox became active again?
<input type="radio" id="parts_upload" class="icheck-input" value="Part_upload" name="upload">
<input type="radio" id="image_upload" class="icheck-input" value="Image_upload" name="upload">
<input type="checkbox" id="parts_clear" class="icheck-input" value="Part_clear" name="clearer">
$(function() {
$("[value=Image_upload]").click(
$("#parts_clear").attr("disabled", true);
);
});
Answer the question
In order to leave comments, you need to log in
Made an example in Angular Light (if you want to try something more high-level).
Everything is simple here:
1) al-radio="upload" value="Image_upload" -> sets the variable upload="Image_upload"
2) al-disable="upload == 'Image_upload'" -> sets disable if the condition upload = is met = 'Image_upload'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question