{%for field in form %} <div class="control-group {%if field.errors %}error{%endif%}"> {# render your field #} </div> {% endfor %}