Ticket #16815: 16815-looping_hidden_fields_docs.patch

File 16815-looping_hidden_fields_docs.patch, 892 bytes (added by joonas, 13 years ago)
  • docs/topics/forms/index.txt

     
    333333these two methods::
    334334
    335335    <form action="/contact/" method="post">
     336        {# Include the hidden fields in the form #}
     337        {% for hidden in form.hidden_fields %}
     338        {{ hidden }}
     339        {% endfor %}
    336340        {% for field in form.visible_fields %}
    337341            <div class="fieldWrapper">
    338 
    339                 {# Include the hidden fields in the form #}
    340                 {% if forloop.first %}
    341                     {% for hidden in form.hidden_fields %}
    342                     {{ hidden }}
    343                     {% endfor %}
    344                 {% endif %}
    345 
    346342                {{ field.errors }}
    347343                {{ field.label_tag }}: {{ field }}
    348344            </div>
Back to Top