Wednesday, November 25, 2009

Re: How to have 2 forms on one page for same model

Thanks,

I got it going in the end although what iv'e done seems a little bit
hacky. Getting the form to recognise the errors passed back seemed
especially problematic. I just wrote a helper that checks for a
error message in the $invalidFields array and placed them underneath
the form items. Elegant? Nope. Pragmatic? for now.

thanks again.

Will

On Nov 26, 12:17 am, Kerr <hayl...@gmail.com> wrote:
> There are some articles on this subject.  You may try this one out.
>
> http://bakery.cakephp.org/articles/view/how-to-create-multirecord-forms
>
> It includes a component called Multirecord that does some looping to
> handle validation.  Be sure to read the comments, as there are some
> bugs in the posted code that the comments address.  On a side note, I
> find that this kind of thing is all too common with people (not just
> Cake bakers) posting code helpers/examples, etc.
>
> On Nov 25, 12:38 am, "#2Will" <willjbar...@gmail.com> wrote:
>
> > Hi All.
>
> > I need to have 2 forms on a page that add an item to the db using the
> > same model.
>
> > The trouble is,  they are setting each others validation off.
>
> > How can i isolate the forms so they still use the models validation
> > but only the form whos button has been clicked gets validated?
>
> > Thanks for any guidence
>
> > Will

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: