The alphaNumeric rule may not be enough if you want spaces, hyphens,
etc. to be accepted as well. If so, try 'rule' => array('minLength',
1) instead.

On Tue, Apr 29, 2008 at 3:36 PM, Marc Schuetze <[EMAIL PROTECTED]> wrote:
>
>  ok I'll be sure to do that.
>
>  thanks for your help
>
>
>
>  On Tue, Apr 29, 2008 at 8:28 PM, jonknee <[EMAIL PROTECTED]> wrote:
>  >
>  >  On Apr 29, 3:13 pm, MarcS <[EMAIL PROTECTED]> wrote:
>  >  > I don't think there's a bug in it.
>  >  >
>  >  > all I have is this
>  >  >
>  >  >         var $validate = array(
>  >  >                 'name' => VALID_NOT_EMPTY,
>  >  >                 'url' => array('rule' => 'url','message' => 'this field 
> must contain a valid url')
>  >  >         );
>  >
>  >  Not a bug per se, just not enough to tell CakePHP that the field is
>  >  required. VALID_NOT_EMPTY is a regex and will only be executed if a
>  >  value is passed. That's somewhat lame, but here's what you do if you
>  >  want it really to be required (just for the name field, you can get
>  >  the idea):
>  >
>  >  var $validate = array(
>  >     'name' => array('rule' => 'alphaNumeric', 'required' => true,
>  >  'message' => 'Required')
>  >  );
>  >
>  >  You have to set required=true.
>  >
>  >
>  > >
>  >
>
>  >
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to