ajax django send array
from django.http import HttpResponse
def edit_lists(request):
tasks = request.POST.getlist('tasks[]')
return HttpResponse('Success')
ajax django send array
from django.http import HttpResponse
def edit_lists(request):
tasks = request.POST.getlist('tasks[]')
return HttpResponse('Success')
ajax django send array
$('.btn-group').find('#mark_as_done').on('click', function() {
var tasks = grab_selected();
$.ajax({
type: 'POST',
url: '/edit_lists/',
data: {'tasks[]': tasks},
});
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us