...
<div class="x-form-item x-tab-item">
<input id="emailRoutine" type="hidden" name="emailRoutine" value="[[+emailRoutine]]" />
<input id="emailRoutineChkbox" type="checkbox" [[+emailRoutine:eq=`1`:then=`checked`]] />
<label class="x-form-item-label" for="emailRoutine">Send notices of dances and events</label>
</div>
...
This question has been answered by multiple community members. See the first response.
<?php
if ($modx->event->name == 'OnBeforeUserFormSave') {
$emailRoutineChkboxVal = '';
$emailRoutineVal = '';
foreach($_POST as $key=>$value) {
if ($key == 'emailRoutineChkbox') {
if ($value == 'on') {
$emailRoutineChkboxVal = 'checked';
}
} else {
if ($key == 'emailRoutine') {
if ($emailRoutineChkboxVal == 'checked') {
$value = '1';
} else {
$value = '';
}
$_POST['emailRoutine'] = $value;
}
}
}
return;
}