I am using Zend_Form_Element_File for a file upload in a form. I have certain
vaidators also. My issue is that if form is not valid other element error
message is showing in ul-li pair. But in the case of file element it is
validating but not showing any error messages. When I debugged error
messages are getting. But it is not renedering to the view. I tried to set
decorators to file element but element it self was not working ... In short,
my question is how do i show error messages for file element as like other
form elements? Help me guys...

My code is here 


$destination            = Zend_Registry::get('baseUrl')."/public/reports";
$stringFileName         = $_SERVER['DOCUMENT_ROOT'].$destination;

$ReportFileName = new Zend_Form_Element_File('ReportFileName');
$ReportFileName->setLabel('Choose File')
-> setDestination($stringFileName)
-> setRequired(true)
-> addValidator('NotEmpty', true, array('messages'
=>Messageclass::setMessage("ER037",'Report File Name')));

// ensure only 1 file
$ReportFileName->addValidator('Count', false, 1);
// limit to 100K
$ReportFileName->addValidator('Size', false, 102400);
// 'xlsx,csv'
$ReportFileName->addValidator('Extension', false, 'xlsx,csv');



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Showing-error-messages-in-phtml-file-for-zend-file-element-tp4659309.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to