jQuery Validation Custom Message Before Listing Errors
Posted
by Michael
on Stack Overflow
See other posts from Stack Overflow
or by Michael
Published on 2010-01-15T06:20:55Z
Indexed on
2010/04/05
16:03 UTC
Read the original article
Hit count: 257
jquery-validate
|jQuery
I am looking to add a custom message before listing my errors for a login page:
"Oops, you forgot to enter the following:" + "Username", "Password" (if both not entered)
or
"Oops, you forgot to enter the following:" + "Username" (if just username not entered)
$(document).ready(function(){
$("#loginForm").validate({
errorLabelContainer: $('#RegisterErrors'),
messages: {
username: "Username",
password: "Password"
}
});
});
With this in my HTML
<div id="RegisterErrors">
© Stack Overflow or respective owner