Okay, I was able to reproduce the error.  So I had a checkbox (I also
had select list), that I set at the bottom of my controller using the
following--rather convoluted--code:
             $active = $this->User->read('active', $id);

               $active = $active['User']['active'];
               if ($active == 1) {
                       $active = true;
               }
               $this->set('active', $active);

(User::active is a 1 or 0)
I then used $active in the view like so:

               echo $form->input('active', array('checked'=>$active));

(I replaced this code using the active data from the $this->data read,
which actually simplified my code in both the controller and the view)

I'm not sure what it is exactly about this code that breaks the
validation errors.  My guess is that since those variables are set and
used upon every load, the validation errors are not told to display
because it thinks that it is simply reloading (even though it is not),
as if you had re-viewed the page.  However, I also use (and kept) two
other variables that I use to create the lists for my select.  I'm not
that experienced with CakePHP, so I can't explain why what I did
works, but perhaps this will give you a start to fixing your problem.
Perhaps someone more experienced will be kind enough to share their
wisdom.

Good luck and let me know if you need me to better explain myself.

Thanks,
~Sarah


On Sep 18, 4:00 pm, Sarah <[email protected]> wrote:
> Nevermind, it is now working.
>
> Thanks for your help!
>
> On Sep 18, 12:49 pm, Sarah <[email protected]> wrote:
>
> > I'm not sure I understand what you mean.  I do not use an element for
> > the form.  I am unaware of any name for a form; I only create the form
> > with the model name.  I would appreciate it if would explain what you
> > are referring to.
>
> > Thanks,
> > ~Sarah
>
> > On Sep 18, 5:08 am, Amit Rawat <[email protected]> wrote:
>
> > > Check your edit view. Your form element name must be different in edit 
> > > view
> > > as compared to add view.
--~--~---------~--~----~------------~-------~--~----~
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