I have the following markup:
<select id="package_id" name="package_id"> <option selected="selected" value="0">Please select...</option> <option value="1017">Taster</option> <option value="1018">Classic</option> <option value="1019">Deluxe</option> </select>
validated as such:
$package = new Select('package_id', $this->pw->select_id_title($entity, true)); $package->setLabel('Available Photoshoot Packages'); $package->addValidator(new ExclusionIn(array( 'message' => 'A Shoots Package must be selected', 'domain' => array('0') ))); $this->add($package);
The idea is that if a "real" value isn't selected from the list, it is posted back as "0" (and it is). However, this doesn't generate a validation error. Is there a well defined way to validate in this scenario?