I have this form element:
$form->input('ChecklistResponseGovernmentInfo.driversLicenseIsOnline', array('type'=>'radio', 'empty'=> true, 'options'=>array(0 => 'No', 1 => 'Yes')))
This is a validation rule for it:
'driversLicenseIsOnline' => array( 'boolean' => array( 'rule' => array('boolean'), 'allowEmpty' => false, ), ),
And this is the database field for it (MySQL):
`driversLicenseIsOnline` tinyint(1) unsigned NOT NULL
When I first upload a new copy of my form, the radio button set is not selected. If I submit the form without any action, when the form reloads, the radio button fills in as "No", and the verification flash message says: "This field cannot be empty."
The problem disappears when I stop using zero (0) as the value for "No", but I want Cake to save this value as a boolean, and not some other value that I would have to translate manually back and forth for boolean .
How to stop Cake from automatically filling in the value for this item when sending it without selecting a radio?
Karew source share