Skip to content Skip to sidebar Skip to footer

Get The List Of Checkbox Post In Django Views

I have this code in my template: {% for email in emails %} {%if email%} {{email}} {% endif %} {%

Solution 1:

Use request.POST.getlist:

Returns the data with the requested key, as a Python list. Returns an empty list if the key doesn’t exist and no default value was provided. It’s guaranteed to return a list of some sort unless the default value provided is not a list.

Post a Comment for "Get The List Of Checkbox Post In Django Views"