var $validate = array(
  'password' => array(
    'rule' => 'alphanumeric',
    'required' => true,
    'allowEmpty' => false
  )
);

'required' means that the form field must be submitted, i.e. you can't
add/update this model without specifying that field.

'allowEmpty' means that if the field is present, it must not be blank.

On Jan 30, 12:40 pm, Marcin Jaworski <[EMAIL PROTECTED]> wrote:
> Try this:
>
> var $validate = array(
> 'password' => array(
> 'rule' => 'alphanumeric',
> 'required' => true
> )
> );
>
> On 30 Sty, 11:06, Reny <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> > I'm using the last beta release and I have this problem:
> > I have in my model that validation rules
>
> > var $validate = array(
> >                 'password' => array(
> >                                 'alphanumeric'  => array(
> >                                         'rule'          => 'alphanumeric',
> >                                         'message'       => 'Only 
> > alphanumeric allowed',
> >                                 ),
> >                                 'required'      => array(
> >                                         'rule'                  => 
> > VALID_NOT_EMPTY,
> >                                         'message'               => 'This 
> > field cannot be
> > empty',
> >                                 )
> >                                 )
> >                         );
>
> > why if I submit form with empty field it's pass validation????
> > why if I pass non alphanum ie \\\\\  it's pass validation????
>
> > I have really no idea :(.
>
> > Thanks all.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to