Commit 08f6871c authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Proper visibility handling of local login form

force display of local login form after invalid form submissions
parent ed4cb3fa
<form action="{% url astakos.im.target.local.login %}" method="post"class="login innerlabels">{% csrf_token %}
<form action="{% url astakos.im.target.local.login %}" method="post"
class="login-form login innerlabels">{% csrf_token %}
<h2 class="form-toggler"><a href="#">LOGIN USING YOUR LOCAL ACCOUNT</a></h2>
<div class="form" style="display:none">
<div class="login-form" style="display:none">
{% with login_form as form %}
{% include "im/form_render.html" %}
{% endwith %}
......@@ -26,10 +27,8 @@
e.preventDefault();
$("div.form").slideToggle();
});
$('div.form .form-row').each(function() {
if ( $(this).hasClass('with-errors') ){
$('div.form').show();
}
});
if ($('form.login-form .form-row.with-errors, form.login-form .form-error').length > 0) {
$('div.login-form').css({display:'block'});
};
})
</script>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment