Задать вопрос

Тел: +7 965 3737 888

473

Просмотров

1

Ответов

save form in ajax with jquery in django

Code how to save ajax.in a form

Вопрос полезен? Да0/Нет0
file_2312.py(2.3Кб)
None

Ответы (1):

Ответmwdiers:25.08.2010
Ответ полезен? Да0/Нет0

You have cruft left over from whatever project you extracted this from.

Line 20: my_form = BetaUserForm(request.POST)

should be deleted.

Line 21 should read:

if my_form.is_valid():

Line 64:

$('#id_beta_user_form') should read $('#id_my_form')

And finally, your view should at least be checking that the request is actually an ajax request, Line 18:

if request.method == 'POST' and request.is_ajax():