頁面:
<form action="" method="POST">
<input type="checkbox" value="1" name="check_box_list"/>1<br/>
<input type="checkbox" value="2" name="check_box_list"/>2<br/>
<input type="checkbox" value="3" name="check_box_list"/>3<br/>
<input type="submit" value="提交"/>
</form>
后台:
def xxx(request):
check_box_list = request.REQUEST.getlist('check_box_list')
#頁面選中的checkbox的value都在這check_box_list里面 下面自己操作