#10090: small error in example code for looping over hidden form fields
---------------------------+------------------------------------------------
Reporter: casey | Owner: nobody
Status: new | Milestone:
Component: Documentation | Version: 1.0
Keywords: | Stage: Unreviewed
Has_patch: 0 |
---------------------------+------------------------------------------------
<form action="/contact/" method="POST">
{% 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 %}
{{ field }}
{% endfor %}
{% endif %}
{{ field.errors }}
{{ field.label_tag }}: {{ field }}
</div>
{% endfor %}
<p><input type="submit" value="Send message" /></p>
</form>
This is from "Looping Over Hidden and Visible Fields" at
http://docs.djangoproject.com/en/dev/topics/forms/#topics-forms-index.
There is an error in the inner for loop foir hidden fields. In this loop,
"{{field}}"" should be "{{hidden}}" to reflect the variable name in the
inner loop.
--
Ticket URL: <http://code.djangoproject.com/ticket/10090>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---