Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: using <select multiple> and POST

I'm using something like this in my template

<select multiple="multiple"  name="services" id="services" size="5">     {% for service in services %}         <option value="{{service.id}}">{{service}}</option>     {% endfor %} </select> 

When I view the POST data in Firebug or the Django debug, I see it only sends one value. Am I doing something wrong or misunderstanding a concept?

like image 305
neoice Avatar asked Mar 06 '09 11:03

neoice


1 Answers

request.POST.getlist('services') 
like image 58
Ignacio Vazquez-Abrams Avatar answered Oct 02 '22 11:10

Ignacio Vazquez-Abrams