I have a form that displays client-side validations as the user enters information and a jQuery script that gets rid of the error messages after a period of time.
However, the script only works once per page load. I do not know much about jQuery so I am just wondering how I get it to work on every validation message?
It currently works fine for just the first error message:
This is the code verbatim in my rails .js file:
window.setTimeout(function() {
$(".field_with_errors label").fadeTo(300, 0).slideUp(300, function(){
$(this).remove();
});
}, 4000);
----Update
Just to be clear: I am using a Rails gem called Client Side Validations that generates new HTML everytime invalid data in entered in the form on this page.