mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #32338 -- Improved accessibility of RadioSelect examples in docs.
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
This commit is contained in:
committed by
Mariusz Felisiak
parent
0393b9262d
commit
d8c17aa10c
@@ -20,16 +20,16 @@ tutorial, so that the template contains an HTML ``<form>`` element:
|
||||
.. code-block:: html+django
|
||||
:caption: polls/templates/polls/detail.html
|
||||
|
||||
<h1>{{ question.question_text }}</h1>
|
||||
|
||||
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
|
||||
|
||||
<form action="{% url 'polls:vote' question.id %}" method="post">
|
||||
{% csrf_token %}
|
||||
{% for choice in question.choice_set.all %}
|
||||
<input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
|
||||
<label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br>
|
||||
{% endfor %}
|
||||
<fieldset>
|
||||
<legend><h1>{{ question.question_text }}</h1></legend>
|
||||
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
|
||||
{% for choice in question.choice_set.all %}
|
||||
<input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
|
||||
<label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br>
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
<input type="submit" value="Vote">
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user