I think you'd have to add two rules which, when combined, only accepts
the data you want. A custom rule should do it too - I'll have a go
tomorrow if this is still open. In the meantime, try this:

http://book.cakephp.org/view/246/decimal

...but with a 0 for the number of decimal places. Don't know if that's
valid or not.

On Nov 26, 10:33 pm, "[email protected]"
<[email protected]> wrote:
> Kind of. But this also allows "0.01"
>
> How would I allow only 0, 1 ...23 and NOT numbers like 0.01
>
> On Nov 26, 7:48 pm, jburns <[email protected]> wrote:
>
>
>
> > array('rule' => array('between', 0, 23),
> >         'message' => 'Please enter a number between 0 and 23.')
>
> > On Nov 26, 6:41 pm, "[email protected]"
>
> > <[email protected]> wrote:
> > > I have an field which is an hour:
>
> > > "hour" => array(
> > >         "required" => true,
> > >         "allowEmpty" => false,
> > >         "rule" => "/^\d{1,2}+/",
> > > ),
>
> > > but how do I also specify that the number MUST be between 0 and 23 ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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