Friday, February 4, 2011

Re: Submitting Django forms with AJAX

Well, I've never seen this method before "request.is_ajax()", so i went to documentation.
And here what i've found:

"Returns True if the request was made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'."

So I though the jQuery already sends this header automatically, but examining the code, I've only found that it sends the 'x-requested-with' maybe that's confusing Django.
So just set this header manually and try again

On 4 February 2011 10:00, David De La Harpe Golden <david.delaharpe.golden@ichec.ie> wrote:
On 04/02/11 01:41, mf wrote:

> I'm very confused about
> how to approach ajax forms submission with django.

I would suggest the ajaxForm plugin.

http://jquery.malsup.com/form/

--
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.




--
Antonio Ribeiro

--
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.

No comments:

Post a Comment