I have a login form which display an error message when there is bad ID or password. It works but if user enter more than once a bad ID or login, the message is printed only once. How to fix it ? This my JS script :
<script type="text/javascript">
$(document).ready(function() {
$("#buttonConnection").click(function(e) {
e.preventDefault();
$.post(
'mypost.php',
{
myID: $("#myID").val(),
myPassword: $("#myPassword").val()
},
function(data) {
if (data == 'Success') {
document.location.href = "dashboard.php"
} else {
$("#resultat").html('Bad ID or password !');
$("#resultat").addClass("alert alert-danger").fadeTo(3000, 0);
}
},
'text'
);
});
});
</script>