Single read-only checkbox becomes unchecked after postback

If a condition changes a checkbox to read-only after you manually checked it, the checkbox will become unchecked after the next postback.

A workaround solution is to add the aslist custom attribute set to true in the checkbox’s custom attributes.

Note that doing this will impact the checkbox value saved in the form data:

  • Before adding the aslist attribute, a single checkbox will save the value true or false, whether it is checked or not.

  • After adding the aslist attribute, however, the single checkbox will save the value defined in the option value field of the checkbox properties.