Yes. you will have to manually set in the view to limit the max
characters that you can enter in a field.

Cake doesn't do this automatically for the front end. The validation
rules are for the server end.


On Nov 5, 8:19 am, chris <[email protected]> wrote:
> Thanks for the reply.
>
> They are text fields in the database, but then I am limiting them by
> the validation rules, so looks like I will have to manually set the
> limits in the view.
>
> On Nov 4, 5:39 pm, euromark <[email protected]> wrote:
>
> > as of now, yes
> > maxlength is determined by the database schema (varchar(36) => 36
> > chars)
> > but i am sure this can be achieved somehow :)
>
> > On 4 Nov., 16:54, chris <[email protected]> wrote:
>
> > > Just getting used to setting validation rules in CakePHP.
>
> > > I notice that the form helper will automatically mark a field if it is
> > > set as required.
>
> > > Is there a way to make the form helper change the size of a input box,
> > > and restrict the number of characters that can be entered, based on
> > > validation rules?
>
> > > I have this sort of thing in the model
>
> > > 'maxlength' => array(
> > >                                 'rule'=> array('maxlength',30),
> > >                                 'message' => 'Name can only be 30 
> > > characters long'
> > >                         )
>
> > > But this does not seem to affect the form controls.
>
> > > Am I asking to much of the form helper?

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