php - How to send field name for required true validation in zend -


here form field,

$this->addelement( 'text', 'title', array(             'placeholder' => 'title',             'class' => 'form-control',             'required'   => true,             'filters'    => array( 'stringtrim' ),             'autocomplete' => 'off',         ) ); 

i need error string like: title required , can't empty.

try this:-

$this->addelement( 'text', 'title', array(         'placeholder' => 'title',         'class' => 'form-control',         'required'   => true,         'filters'    => array( 'stringtrim' ),         'autocomplete' => 'off',         'validators' => array(                 array('notempty', false, array('messages' => array(zend_validate_notempty::is_empty => 'title required , cant empty')))         )     ) ); 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -