I have attempted to put the readonly attribute for a single checkbox. I inspect the element and I can see the attribute readonly=readonly although you are still able to interact with the checkbox. Is there anyway to make a single selection readonly? The reason for this is that a default value is needed to be shown but not removable.
Question
Question
Making a single checkbox readonly
asked on December 28, 2017
0
0
Answer
SELECTED ANSWER
replied on December 29, 2017
I don't know if its actually possible to make only one selection read only but you could always re-check the box if it is changed. Essentially making it read only.
Here the first check box ( Item 0 ) will be checked and not rechecked any time any checkbox is updated.
$(document).ready (function () { document.getElementById('Field7-0').checked = true; $('#q7').change(function(){ document.getElementById('Field7-0').checked = true; }) });
~ Andrew
0
0