Skip to content

Commit

Permalink
Shade input cell background for error fields in forms.
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmt committed Aug 16, 2010
1 parent 9b2e85d commit f7f11a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion general/templates/general/form_tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 4 additions & 1 deletion static/css/style.layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

form th, form td {
border-color: #b7ca79;
line-height: 2.5em;
}

form th {
Expand Down Expand Up @@ -89,3 +88,7 @@ form table .errors {
list-style: none;
}

.error_field {
background: #faa;
}

0 comments on commit f7f11a0

Please sign in to comment.