Correctly mark checkboxes and radio buttons as mandatory (see #6352)