I have written a custom validator that throws an error if the user did not
enter a valid URL or uploaded a media file. 

I have attached this validator to the URL field. It works fine, but ONLY run
if the visitor entered a value in the URL field. If the visitor leaves the
URL field empty the validator does not fire.
$this->getElement('med_url')->addValidator('UrlOrFile');

Is this expected behaviour?
Is there a way I can make sure the validator fires even if the URL field is
left empty?

(I worked around the problem for now by attaching the validator to a hidden
field that always has a value, but this is is a very ugly workaround)
-- 
View this message in context: 
http://www.nabble.com/Custom-validator-not-run-when-a-Zend_Form-field-is-empty--tp23666798p23666798.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to