I have a list of items, each item having two checkboxes; available and purchased. The item can be available without being purchased. But it cannot not be purchased without it being available. Therefore, I want the user to be able to check purchased and have 'available' auto-checked if it isn't already. This is more as a visual aid to the user feedback since when the form is submitted I can then look to see if purchased was checked and then assume available is as well(since it should be).
<input type="checkbox" name="ua0" id="ua0" value="1" onclick="ub0.checked=true">
<input type="checkbox" name="ub0" id="ub0" value="1">
This almost works as I want. However, once you click on A and then B is auto-checked, if the user unchecks B manually then unchecks A, B gets rechecked. So perhaps, is there a way to only update B when A is being checked and not unchecked?