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:
Julien Phalip 2011-09-13 08:22:53 +00:00
parent c76112cf1d
commit 3513234cf8
1 changed files with 5 additions and 8 deletions

View File

@ -333,16 +333,13 @@ and visible fields independently: ``hidden_fields()`` and
these two methods:: these two methods::
<form action="/contact/" method="post"> <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 %} {% for field in form.visible_fields %}
<div class="fieldWrapper"> <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.errors }}
{{ field.label_tag }}: {{ field }} {{ field.label_tag }}: {{ field }}
</div> </div>