Ah cunning! Thanks - that's a great idea. On Sep 13, 8:13 am, bruno desthuilliers <bruno.desthuilli...@gmail.com> wrote: > On 13 sep, 13:48, Stodge <sto...@gmail.com> wrote: > > > I'm working through a nice little feature for my website that will > > bring all user editable preferences/profile options together into a > > single web page using tabs. I have the tabs working and I can display > > a different Django form on each tab but I'm confused how to tie it all > > together using a view. > > > Typically each form would be on a separate page using different views. > > But how would I support say three forms on one page (in three tabs)? I > > need one view to generate all of the tabs but one view can't support > > three forms? > > Yes it does. You just need to have a way to know wich form was > actually submitted. > > > What's the best way to implement this? > > The simplest way is to add an hidden field in each form, with a value > identyfing the form. Then in your view you just have to select the > appropriate form class based on this identifier (using a > identifier:form_class dict being the obvious solution).
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.