mirror of https://github.com/django/django.git
Fixed #16815 -- Rectified the code example for hidden_fields and visible_fields in the forms documentation. Thanks, joonas.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c76112cf1d
commit
3513234cf8
|
@ -333,16 +333,13 @@ and visible fields independently: ``hidden_fields()`` and
|
|||
these two methods::
|
||||
|
||||
<form action="/contact/" method="post">
|
||||
{# Include the hidden fields #}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{ hidden }}
|
||||
{% endfor %}
|
||||
{# Include the visible fields #}
|
||||
{% for field in form.visible_fields %}
|
||||
<div class="fieldWrapper">
|
||||
|
||||
{# Include the hidden fields in the form #}
|
||||
{% if forloop.first %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{ hidden }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{{ field.errors }}
|
||||
{{ field.label_tag }}: {{ field }}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue