javascript - getting the button enable or disable if the radio button is checked or unchecked

Solution:
You can't uncheck a radio button, but if you want to do it on a checkbox, here is a suggestion using jquery:
$("#checkBoxID").on("change", function(e) {
$("#buttonID").prop("disabled",!$("#checkBoxID").is(":checked"));
});
This will set the disabled attribute on the button to the opposite of the checked attribute.
•Box Checked? Disabled Attribute on button set to false
•Box unchecked? Disabled attribute on button set to true
Updates dynamically as the checkbox is selected.
-- edit --
Here is a link to a JSFiddle of this working as described and requested.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: cannot access offset of type string on string
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.