To clarify, there are two approaches. 1. Single controller handling both forms. My image of this approach is: fiddly, sticky, yucky. Too much if-else, etc.
2. Two controllers. If forms are doing different things, it makes a lot of sense to just have two controllers dedicated to handling each form. You can have helper functions (or instance methods on superclass for your controller) to handle any common functionality. I think it'd be far more readable and elegant, and you won't have to have hidden fields or anything of the kind. There's also another solution, and that'd be single-form. As you all know, submit buttons have values and names, just like any other field, and you can tell which submit button was used to submit the form. Again, it's most like solution 1, but at least you've got a single form to worry about with common validation code, etc. 2011/1/24 Branko Vukelić <[email protected]>: > Ok, so those are two separate forms, each with it's own validation. > The template that is returned is the same. What's the problem? > > On Mon, Jan 24, 2011 at 9:42 PM, andrei <[email protected]> wrote: >> Branko, doing your way, how would you display inline validation >> errors? >> >> On Jan 24, 10:38 pm, Branko Vukelić <[email protected]> wrote: >>> On Mon, Jan 24, 2011 at 2:35 PM, ilejn <[email protected]> wrote: >>> > Hello! >>> >>> > What is the best way to put two forms at one Web page? >>> >>> To me it'd make most sense to just point them to different URLs, and >>> then proceed as usual. >>> >>> -- >>> Branko Vukelic >>> >>> [email protected]http://www.brankovukelic.com/ >> >> -- >> You received this message because you are subscribed to the Google Groups >> "web.py" 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/webpy?hl=en. >> >> > > > > -- > Branko Vukelic > > [email protected] > http://www.brankovukelic.com/ > -- Branko Vukelic [email protected] http://www.brankovukelic.com/ -- You received this message because you are subscribed to the Google Groups "web.py" 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/webpy?hl=en.
