Perfect. I actually realized soon after posting that option 1 would
work well for this scenario, but option 2 would be a good future
enhancement.

Thanks for your help.

On Jun 29, 11:56 am, Rajesh Dhawan <rajesh.dha...@gmail.com> wrote:
> delinowrote:
> > Rajesh,
>
> > Thanks for your response. If I post the form to a dedicated view that
> > works fine, but how do I handle validation properly in this approach.
> > Say the user enters invalid data, do I now need to redirect them back
> > to the original page and then display these errors? That seems like it
> > will be a headache as well. Note that this form is a reusable form
> > that gets displayed within most templates so it's just a little
> > section of the page. If I now enter invalid data and post the form,
> > it's going to post to a different view that will then see the form is
> > invalid and then what??
>
> Option 1: Send your invalid form to a simple template that knows how
> to display the form and its errors.
>
> Option 2: Post your form via AJAX -- you should still implement Option
> 1 for people that have turned off Javascript
>
> -RD
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to