I'm waiting to get an error if I type something
different between password and repassword.
What happens the code don't catch the error :(
Bye.
Matthew Weier O'Phinney-3 wrote:
>
> -- whisher <whisher@mp4.it> wrote
> (on Monday, 07 September 2009, 08:32 AM -0700):
>> Hi. What's wrong in this code
>
> What are you expecting to happen, and what is actually happening?
>
>> $request = Zend_Controller_Front::getInstance()->getRequest();
>> $password = $request->getParam('password', '');
>> $this->addElement('password', 'password', array(
>> 'required' => true,
>> 'maxlength' => 15,
>> 'title' => 'Sono ammessi solamente caratteri alfanumerici e
>> @,#,*',
>> 'label' => 'form_User_Register_Label_Password',
>> 'filters' => array('StringTrim'),
>> 'validators' => array(
>> array('stringLength',true, array(2, 25)),
>> array('regex', false,
>> array('#^[^\.<>{};:"£$%\/^&()_\+\-=\]\[]+#')))
>> ));
>>
>> // Re-Password
>> $repassword = $request->getParam('repassword', '');
>> $this->addElement('password', 'repassword', array(
>> 'required' => true,
>> 'maxlength' => 15,
>> 'title' => 'Sono ammessi solamente caratteri alfanumerici e
>> @,#,*',
>> 'label' => 'form_User_Register_Label_RePassword',
>> 'filters' => array('StringTrim'),
>> 'validators' => array(
>> array('stringLength',true, array(2, 25)),
>> array('regex', true,
>> array('#^[^\.<>{};:"£$%\/^&()_\+\-=\]\[]+#')),
>> array('identical',false, array($password ,$repassword))
>> )
>> ));
>
> --
> Matthew Weier O'Phinney
> Project Lead | matthew@zend.com
> Zend Framework | http://framework.zend.com/
>
>
--
View this message in context: http://www.nabble.com/Validation-identical-in-the-form-tp25332316p25341704.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论