How to make whe开发者_开发技巧re do the error message show in jquery.validate??
You can check out the documentation here: http://docs.jquery.com/Plugins/Validation
You define the .error style and jQuery creates the element as needed (as the next sibling to the input field) on validate.
Here is their sample style:
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
And here is an example of an element created on error:
<label for="cname" generated="true" class="error">Please enter at least 2 characters.</label>
精彩评论