Commits

Kai Diefenbach committed 6a59978

Improved error message for checkout form (Andres Vargas / zodman); issue #87

Comments (0)

Files changed (2)

lfstheme/static/css/main.css

     padding-right: 10px;
 }
 
+.checkout #form-error {
+    background: none repeat scroll 0 0 #FBE3E4;
+    border-color: #FBC2C4;
+    color: #8A1F11;
+    border: 2px solid #DDDDDD;
+    margin-bottom: 1em;
+    padding: 0.8em;
+}
+
+.checkout #form-error  p {
+    padding-bottom:0.8em;
+}
+
 /* Login / Register
 ___________________________________________________________________________ */
 

lfstheme/templates/lfs/checkout/one_page_checkout.html

 {% endblock %}
 
 {% block wrapper %}
-	{% if form.errors %}
-	<div id="form-error">
-		<p>The operation could not be performed because one or more error(s) occurred.<br />Please resubmit the form after making the following changes:</p>
-		<ul>
-		{% for field in form %}
-			{% if field.errors %}<li>{{field.label}} - {{ field.errors|striptags }}</li>{% endif %}
-		{% endfor %}
-		</ul>
-	</div>
-	{% endif %}
+    {% if form.errors %}
+    <div id="form-error" class="error">
+        <p>{% blocktrans %}The operation could not be performed because one or more error(s) occurred.<br />Please resubmit the form after making the following changes:{% endblocktrans %}</p>
+        <ul>
+        {% for field in form %}
+            {% if field.errors %}<li><a href="javascript:void(0);" onclick="$('#id_{{ field.name }}').focus();">{{field.label}}</a> - {{ field.errors|striptags }}</li>{% endif %}
+        {% endfor %}
+        </ul>
+    </div>
+    {% endif %}
     <div>
         <form class="checkout-form"
               method="post"