Javier Nievas wrote:

I have a list of items, each one with a checkbox to select it. I want
to post this info to a django view, but i don't know how should I use
the name="" and value="" of the input tag to gain access to it from
django as it if was an array.
Give them all the same name but different value.

   <input type="checkbox" name="array" value="{{id}}">

Then when you submit a form browser will send values of checked checkboxes and then in a view you can do

   request.POST.getlist('myfield')

this'll give you normal Python list with values of all checked checkboxes.

Reply via email to