Skip to content

Instantly share code, notes, and snippets.

@bradwright
Created October 26, 2009 15:11
Show Gist options
  • Save bradwright/218722 to your computer and use it in GitHub Desktop.
Save bradwright/218722 to your computer and use it in GitHub Desktop.
<div class="form_row{% if field.errors %} has_errors{% endif %}{% if class %} {{ class }}{% endif %}{% if field.field.required %} required{% endif %}">
<label for="{{ field.auto_id }}">
{% if label %}{{ label }}{% else %}{{ field.label }}{% endif %}
{% if field.field.required %}<span>(required)</span>{% endif %}
</label>
{{ field }}
{% if field.errors %}
<p class="error">{{ field.errors|join('<br>') }}</p>
{% endif %}
{% if help_text %}
<p class="helptext">{{ help_text }}</p>
{% elif field.help_text %}
<p class="helptext">{{ field.help_text }}</p>
{% endif %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment