pr($this->validationErrors) in your view will show you the errors.
---
Brett Wilton
http://wiltonsoftware.com
On Fri, Sep 19, 2008 at 12:31 PM, David C. Zentgraf <[EMAIL PROTECTED]> wrote:
>
> On 18 Sep 2008, at 23:53, 703designs wrote:
>
>> So a rendered view will automatically receive validati
On 18 Sep 2008, at 23:53, 703designs wrote:
> So a rendered view will automatically receive validation messages? In
> which variable?
Yes. When a model is validated in the controller, invalid fields will
be noted in a variable. Don't know of the top of my head in which one,
do a debug($this)
So a rendered view will automatically receive validation messages? In
which variable? If I need to set a var, what should my target be
($this->set('errors', /* what here? */))? I tried substituting a
minLength 1 rule yesterday and if it worked, I would not have changed
it, although I can't with ce
I'm not 100% sure, but I think older versions of Cake required you to
specify a rule. If you're only interested in the 'required' field,
specify a rule that'll always validate, like '/.*/' . What version of
Cake are you using?
Structure your app the way you see fit. It's not good form to us
Note that each ['validate'] key also has a normal ['message'] defined,
saying that the field in question is required.
On Sep 18, 9:29 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> On 18 Sep 2008, at 21:50, 703designs wrote:
>
> > I got funny preg_match errors
>
> Show us your $validate rul
Right, that was a typo, not a paste. I think that you'll be able to
better help me if you understand how I've designed my contact form:
Model: Contact[name, email, city, subject, message, and a couple
others]
Model['validate']: Name, email, and message have 'required' => true
Views: index (just p
On 18 Sep 2008, at 21:50, 703designs wrote:
> I got funny preg_match errors
Show us your $validate rules then or go through them with a fine comb.
> $this->Contact->set('$this->data);
I hope this is not copy&pasted as it's invalid PHP.
> This controller's 'add' method just sends out emails
>
I saw that last night before posting, and wrapping the send sequence
in this conditional didn't work: I got funny preg_match errors (also
noted here:
http://ryan.ifupdown.com/2008/08/24/delimiter-must-not-be-alphanumeric-or-backslash-corecakelibsmodelmodelphp-line-2202/
, although his fix didn't
Are you looking for this?
http://book.cakephp.org/view/410/Validating-Data-from-the-Controller
On 18 Sep 2008, at 13:51, 703designs wrote:
>
> How can I check if the data is valid before trying to send the mail
> out? Validation errors are falling into the "email failed" condition,
> and validat
How can I check if the data is valid before trying to send the mail
out? Validation errors are falling into the "email failed" condition,
and validation errors aren't reported to the user.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
10 matches
Mail list logo