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
Post a Comment