Hi Dave, you might check your spelling real quick: minLenght should be
minLength. That's probably why your length validation is always
passing.

On Sep 15, 8:30 am, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> I am finally getting around to implementing the validation rules but seem to
> be not quite understanding it or something.
>
> I have this set up to validate Username:
> ....
> 'username' => array(
>              'user-notempty' => array(
>                   'rule' => array(
>                       'minLenght', 8),
>                   'required' => true,
>                   'allowEmpty' => false,
>                   'last' => true,
>                   'message' => 'User name must be a minimun of 8
> characters.'),
>              'user-unique' => array(
>                 'rule' => array('checkUnique', 'username'),
>                 'message' => 'Username taken. Use another')),
> ....
>
> Now it checks the unique factor just fine if there is a match when I test it
> but if i enter a Username that is less than 8 characters it does nothing in
> validation. It passes as OK.
>
> I also can not seem to validate fields that are not  in a database such as
> when I want to change the password. User enters new password in new_pass
> field and new_confirm in new_confirm field. There are no fields in the db
> for these fields but i added :
>
> 'new_confirm' => array(
>              'notempty' => array(
>                   'rule' => array(
>                       'minLenght', 8),
>                   'required' => true,
>                   'allowEmpty' => false,
>                   'message' => 'Please confirm your password.'
>                   )
>              ),
>
> 'new_pass' => array(
>              'notempty' => array(
>                   'rule' => array(
>                       'minLenght', 8),
>                   'required' => true,
>                   'allowEmpty' => false,
>                   'message' => 'Please enter a password with minimum 8
> characters.'
>                   )
>              ),
>
> I read the cookbook validation section and it makes sense to me but
> obviously am doing something wrong.
>
> Ideas where I went wrong?
>
> Thanks
>
> Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to