Skip to content

Commit

Permalink
Fixed #16815 -- Rectified the code example for hidden_fields and visi…
Browse files Browse the repository at this point in the history
…ble_fields in the forms documentation. Thanks, joonas.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jphalip committed Sep 13, 2011
1 parent c76112c commit 3513234
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions docs/topics/forms/index.txt
Expand Up @@ -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>
Expand Down

0 comments on commit 3513234

Please sign in to comment.