Thursday, February 26, 2009

Re: Automagic JavaScript Validation

'range' is for numeric values, not strings like your display name.
use array('between', 5, 15)

On Feb 26, 8:00 am, kaushik <kaushikwo...@gmail.com> wrote:
> I am using Automagic JavaScript Validation. for password i am using
> this code:
>
> 'password' => array(
>                 'required' => array('rule' => array('minLength', 7),
> 'message'=>'Minimum Length of Password is 7'),
>         )
>
> It is working perfectly. but for another field I want to maintain the
> length between 5 and 10. I am using 'range' for this porpose like
> that:
>
> 'displayName' => array(
>                 'required' => array('rule' => array('range', 1,10),
> 'message'=>'Please enter a display name'),
>         )
>
> But it is not working. Can anyone tell me, how to mention the limit
> for range.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: