delino wrote:
> 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
-~----------~----~----~----~------~----~------~--~---