ajax django send array 1

ajax django send array

from django.http import HttpResponse

def edit_lists(request):
    tasks = request.POST.getlist('tasks[]')
    return HttpResponse('Success')

Here is what the above code is Doing:
1. The request.POST.getlist() method returns a list of values for the given key.
2. The tasks variable is a list of all the tasks that were checked.
3. The HttpResponse() method returns a response to the browser.

Similar Posts