djang如何获取checkbox的值
HTML code
<form action="" method="POST"><input type="checkbox" value="1" name="check_box_list"/>1
<input type="checkbox" value="2" name="check_box_list"/>2
<input type="checkbox" value="3" name="check_box_list"/>3
<input type="submit" value="提交"/>
</form>
后台:
Python code
def xxx(request):
check_box_list = request.REQUEST.getlist('check_box_list')
#页面选中的checkbox的value都在这check_box_list里面 下面自己操作