Re: how to display form data with original values after validation failure?
Thanks for your reply, Shawn.
I'll think about that - but I think I would prefer to use more boiler-
plate Django form behavior and just get a formset with errors returned
to my template in the full-page response.
On Jun 21, 5:44 pm, Shawn Milochik <sh...@milochik.com> wrote:
> One good way is to just use AJAX: If it's a 'get' request, return your
> rendered template as normal. If it's a 'post' request, return a JSON
> response that has a success/failure status and confirmation/error
> messages (form.errors.as_text()).
>
> I'm doing this using jquery-notify to tell the user that it went great
> or what the problem was:http://www.erichynds.com/examples/jquery-notify/
>
> If you need to redirect or refresh the page on success you can handle
> that with JavaScript as well. In addition to being faster than a
> full-page refresh this happens to solve your problem.
>
> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home