fTo disable and enable checkbox, use the attr() method.Initially set the input type checkbox and disable it − Or is it by design? a) define checkbox as read only and use CSS to make it look like it disabled b) define is as normal or readonly and "hidden" c) dynamically add a hidden input or a checkbox to a form uppon submission var text = document.getElementById("text"); // If the checkbox is checked, display the output text. Im going to bed, but i think this could be useful for you, it toggles checkboxes... you can modify it to suit your needs. If any different checkbox from either group is checked (val 1 or 2), it must uncheck the two val 0 boxes. It returns true if the checkbox is checked, else false − Example. If it has been checked, then it sets the disabled property on our submit button to FALSE. How to clear your Facebook app cache on Android. Syntax: It returns the Input Checkbox disabled property. is it possible to disable checkbox selection by preserving some selected rows rendered with some constraints? We determine whether the checkbox is checked and can take action based on that.. Handling a Group of Checkboxes Onclick. If a checkbox is checked, then the value of the related checkbox is added to the idList variable. Inside the function assigned onclick, we access the checked and value properties of the checkbox using the this keyword. document.getElementById('ck1').disabled=true; To make it … We have used getElementByID to know about the checkbox. Home. To check whether a checkbox is checked, try to run the following code. Inside this function, based on whether CheckBox is checked (selected) or unchecked (unselected), the TextBox is enabled or disabled by setting the disabled property to false or true respectively. i.e. First, select the checkbox using the selecting DOM methods such as getElementById ()... Getting values of multiple selected checkboxes. Open a URL in a new tab (and not a new window) using JavaScript, Get selected value in dropdown list using JavaScript. Accessing nested JavaScript objects with string key. The HTML form below is a slightly-modified version of the form that we created above. I have added a Checkbox for … Let’s start off with an example that does not use JQuery. How to change an element's class with JavaScript? but there seem to be some pagelifecycle issues with the script I am using. A disabled checkbox is unclickable and unusable. Disable Fields When User Selects Checkbox.