Read Only - Checkbox or Radio Buttons Only

Sets only checkbox and radio button elements contained with a container to read-only and shows their values as text. This is accomplished by overriding the expression option with input:checkbox, input:radio, which selects only input elements that have a type of "checkbox" or "radio". All other elements are not selected and, as such, are ignored by the disabler plugin.

To indicate that you want an element to display its value as text when set to read-only, add the class disabler-show-text-readonly to the element. To specify a specific value to be displayed when the disabler-show-text-readonly is set, add the data attribute data-disabler-read-only-display on the element with desired display value. For example, the radio buttons and check boxes on this page have the data-disabler-read-only-display attribute associated with them to indicate the text to display instead of using the actual value of the control.

This demo assigns the disabler-hide-readonly class to some controls to indicate that you want the disabler to hide the control when set to read-only. Those elements that have the disabler-hide-readonly class associated to it will never be ignored.

Click the "Set Read Only" button to see it in action. View the source of this page to see the code.



  This link will show as text when read only
This link will hide when read only