python - Multidimentional array inside checkboxes -
python - Multidimentional array inside checkboxes -
is there way can set html checkbox bidimentional array, this:
<input type=checkbox name=message[group1][1] value=1>
if yes,
1) how should accomplish in case illustration wrote wrong?
2) how access elements request handler in django?
yes, can utilize such checkboxes names, it's string. elements on server side generate checkboxes names , values. this:
def multi(request): arr = [] x in range(1, 6): cur_row = [] arr.append(cur_row) y in range(1, 6): curr_cell = bool(request.post.get('message[group%d][%d]' % (x, y))) row.append(curr_cell) homecoming httpresponse('ok')
but server needs know ranges come process checkboxes. set 1..5 range example.
ps. value
attribute valid checkboxes? checked
attribute?
python django
Comments
Post a Comment