|
|||
|
I can't get Zend_Validate_Identical to work. It just always says "No token was provided to match against", no matter what.
PHP Code:
Also, I need to compare one form field to another form field (password to confirm password), and the easiest way I could think while following the validation model was to write a custom validator, something like Zend_Validate_IdenticalToField that would just take in a form element, and call it's getValue method for comparison. Is there some better way this could be implemented within the Zend_Form / Zend_Validate pattern? Also, what about a UniqueInModelField validator that checks against a model for any existing entries that would conflict, like for a unique email address? These are probably outside of the scope of Zend_Validate by quite a bit though. What do you guys think? |
|
|||
|
you should use this:
array('Identical', $variable) if you set 'test', the validator compares text from your input field with the 'test' word if you have input field named 'test', you should write something like that: array('Identical', $this->getRequest()->getParam('test')) in other words: Code:
//password entered in the form
$password = $this->getRequest()->getParam('password');
//repeat password field in your form
$form->addElement('password', 'repeat_password',
array(
//...
'validators' => array(
//...
array('Identical', $password)
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|