On Fri, Mar 18, 2011 at 12:32 PM, Shawn Milochik <sh...@milochik.com> wrote:
> It's possible to do this by manipulating the post data. It's probably > cleaner (and more easily reusable) to do it in the form's __init__ > than in the view itself, though. > > I don't know what these fields are meant to contain, but assuming one > is more important than the others, what if they leave the required one > blank but fill in the other two -- how do you decide which is > important enough to become #1? > > If your requirements are that at least one of the fields be filled in, > why not just make them all optional and add the check for at least one > being filled in in the form's clean()? > > Shawn > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@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. > > You might prefer to use javascript (jquery) and show only the first field. When the user leaves the field and if it isn't blank, unhide the second field. Or in clean, if first is blank, copy second to first, third to second, then empty third. -- Joel Goldstick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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.