Or you can validate those fields before you save and errors are found,
use the session flash variable to show the error message.
On Nov 29, 9:18 am, "Dave Maharaj" <m...@davemaharaj.com> wrote:
> I am taking a single Model.phone and breaking the input up into 3 inputs
> (area_code) - (prefix) - (suffix) so my question is how do I validate that?
> I can merge the data to get my Model.phone and run standard validation on
> that but how to get the message on error back to the view since Model.phone
> is not on the page?
>
> My guess is validate each 3 if valid merge the data to get my Model.phone,
> but if any of the 3 are not valid (area_code) - (prefix) - (suffix) I only
> want 1 error message.
>
> I do not want individual error messages for the 3 inputs since everyone
> knows a phone number is NUMBER if they want to waste their time putting in
> letters and junk well then go ahead, I only want to return 1 error message
> for the full Model.phone (wrong length, not empty stuff like that
>
> Any ideas how to do this? Standard submit no js checking.
>
> Thanks,
>
> Dave
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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment