summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJulien Phalip <jphalip@gmail.com>2011-09-13 08:22:53 +0000
committerJulien Phalip <jphalip@gmail.com>2011-09-13 08:22:53 +0000
commit3513234cf8a9ca0195536f7856729049adbd8444 (patch)
tree51708f3945992aee76331c5f7286621cb53d385e /docs
parentc76112cf1d98bf68d78ca876dffd50f4091d0ca8 (diff)
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
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/forms/index.txt13
1 files changed, 5 insertions, 8 deletions
diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt
index 234417bf00..5b6f87fbec 100644
--- a/docs/topics/forms/index.txt
+++ b/docs/topics/forms/index.txt
@@ -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>