On Apr 21, 12:54 am, Jeremy Burns <[email protected]> wrote:
> Might it be something to do with the field name? What happens if you rename 
> it to election_office?

ElectionOffice is the model name.

I got the error msg to show up properly, though. I debugged $form-
>validationErrors:

Array
(
    [Election] => Array
        (
            [ElectionOffice] => Please select at least one Office
        )

)

So, $form->error('Election.ElectionOffice') does the trick.

But it still won't save if an Office is selected but that validation
rule is present. I can't figure out how to debug what's going on when
that rule is encountered. The data comes in like:

Array
(
    [ElectionOffice] => Array
        (
            [ElectionOffice] => Array
                (
                    [0] => 1
                    [1] => 2
                    [2] => 3
                    [3] => 4
                    [4] => 5
                )
        )
    [Election] => Array
        (
            [deadline] => 2010-04-29
        )
)

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