Bonsoir,
Dans ton template,
<form method="GET" action=".#FormResponse">
<td style="text-align: center">
<input type="checkbox" name="result" value="Bike" /> j'ai un
vélo<br />
</td>
<td style="text-align: center">
<input type="checkbox" name="result" value="Car" /> J'ai une
voiture
</td>
<input type="submit" value="Tester" />
</form>
Dans views.py
result = request.GET.getlist('result', False)
if result:
print result
résultat:
[10/Apr/2012 20:31:56] "GET /web/css/images/arrow-up.gif HTTP/1.1" 304 0
[u'Bike', u'Car']
[10/Apr/2012 20:32:00] "GET /contact/?result=Bike&result=Car HTTP/1.1" 200
10158
Documention:
http://www.softwarematrix.cn/blog/django/django-request-post-getlist
Bonne continuation.
2012/4/10 sesame <[email protected]>
> si j'ai
> <form action="{% url chercher_filtre %}" method="get" onsubmit="
>
> <td style="text-align:center"><input type="checkbox" id="theCheck1"
> name="validation" value="1"></td>
> .....
>
> dans views.py :
>
> if request.method == 'GET':
> liste = request.GET.getlist('validation')
> print liste
>
>
> j'ai liste=[] ??
> _______________________________________________
> django mailing list
> [email protected]
> http://lists.afpy.org/mailman/listinfo/django
>
--
*App Concept Lab*
*app-concept-lab.fr ( à venir )*
*Vos applications ont du talent !*
*M Brisson Namgyal*
*Mobile* *06.36.91.35.30*
*Fixe* *09.51.59.30.45**
**Mail** [email protected]**
***
_______________________________________________
django mailing list
[email protected]
http://lists.afpy.org/mailman/listinfo/django