I have checkboxes with randomly generated ids on every page view and want to preselect and disable some of them, so they can not get unchecked anymore. Is it possible?
With a simple script which looks after value="" I'm able to achieve the preselection but if I try to disable it at the same time, it disables all input fields on the page.
On closer inspection I found out that they have these attributes in common: <div id="cb-selection">and <input name="mycb">.
What would be your solution if we had this:
<form method="post" id="submit-this" class="" enctype="multipart/form-data">
<div id="cb-selection">
<div>
<input type="checkbox" name="mycb" id="?" value="Check1">
<label for="?"> Check1 </label>
</div>
<div>
<input type="checkbox" name="mycb" id="?" value="Check2">
<label for="?"> Check2 </label>
</div>
<div>
<input type="checkbox" name="mycb" id="?" value="Check3">
<label for="?"> Check3 </label>
</div>
</div>
</form>
I would appreciate any help.