hi i am using a zend image element in my project , i have validated the field . if i choose other than an image and submit the form , a default error message is displayed , i tried to remove it and add a custom message by
$image->removeDecorator('Error');
$image->addErrorMessage('Invalid image');
but it is not working . the error message is
File '.zfproject.xml' is no image, 'application/xml' detected
how can i add a custom error message and remove the default error meassage , please help ....
this is my code
$image = new Zend_Form_Element_File('image');
$image->setLabel('Image URL :');
$image->setDestination($imagePath);
$image->addValidator('IsImage', false);
//$image->removeDecorator('Error');
//$image->addErrorMessage('tester');