of course you can!...and you should! ;) CakePHP Models let you spice them
with custom validations, when in a validation array you say 'rule' =>
array()
the first parameter of the array can be the name of a custom validation
function in your model, then, when validation is fired up, your custom rule
will fits nicely with the flow
here is an example http://pastie.org/838388 (code)
--
anl


On Tue, Feb 23, 2010 at 11:35 AM, Zac Tolley <[email protected]> wrote:

> I have created a form with the html and form helpers and setup
> validation rules in my model and this seems to work pretty well
> (anyone got this integrated with jquery?)
>
> I have a question though, in my form I have a couple of extra fields,
> one is a checkbox to accept terms and conditions, and another is a
> password validation field (they type in new password twice).
>
> Now, I can easily put some logic into the controller to check these
> things when the form is submitted, but is there any way I can do this
> in such a way that it fits into the cake flow, so if one of my checks
> fails it go back to the form and puts up a messing below the filed in
> the same style, or am I going to do this manually?
>
> 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]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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