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

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -