So I've determined that my validator does not get called when I filter the input value and turn zero into null.
$this->addElement('select', 'State_ID', array('label' => 'State', 'multiOptions' => $this->getStates(), 'validators' => array($requiredBasedOnCountry), 'filters' => array($makeZeroNull)));
The reason I am doing this is because I don't want to insert 0
into the database. When I call getValues()
on the form, I don't want to have to change each one manually. But I want to also validate the input. How can I filter the value, and also validate it?