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 -

spring cloud - How to configure SpringCloud Eureka instance to point to https on non standard port -

javascript - Bootstrap Popover: iOS Safari strange behaviour -