I want to submit a value if a checkbox is unchecked (on a node edit form).
Using theme_form_element I can add the hidden field as follows:
$variables['element']['#children'] = '$variables['element']['#name'] . '" value="0" />' . $variables['element']['#children'];
But on submit, because value 0 is not in the allowed values list, I get the 'An illegal choice has been detected. Please contact the site administrator.' error message.
How can I bypass this validation and/or submit the value 0 for each unchecked checkbox?