How do I get the values of all selected checkboxes in a Django request.POST?

前端 未结 2 1305
感情败类
感情败类 2020-12-12 17:53

Hi I have an array of checkboxes e.g.




        
2条回答
  •  孤街浪徒
    2020-12-12 18:41

    This will fix your problem,

    some_var = request.POST.getlist('checks[]')
    

    If you write some_var = request.POST.getlist('checks') may not work properly.

提交回复
热议问题