Permalink
Browse files

Shade input cell background for error fields in forms.

  • Loading branch information...
1 parent 9b2e85d commit f7f11a043ec464dfd4509064f086fd4ec6c32b69 @malcolmt committed Aug 16, 2010
Showing with 6 additions and 2 deletions.
  1. +2 −1 general/templates/general/form_tag.html
  2. +4 −1 static/css/style.layout.css
@@ -5,7 +5,8 @@
<th>{% if show_required and field.field.required and field.field.widget.input_type %}
<span class="required">(*)</span>{% endif %}
{{ field.label }}</th>
- <td>{{ field }}{% if forloop.first %}
+ <td {% if field.errors %}class="error_field"{% endif %}>{{ field }}
+ {% if forloop.first %}
<input type='hidden' name='csrfmiddlewaretoken' value='{{ csrf_token }}' />
{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
{% endif %}</td>
@@ -54,7 +54,6 @@
form th, form td {
border-color: #b7ca79;
- line-height: 2.5em;
}
form th {
@@ -89,3 +88,7 @@ form table .errors {
list-style: none;
}
+.error_field {
+ background: #faa;
+}
+

0 comments on commit f7f11a0

Please sign in to comment.