herghost Posted January 4, 2011 Share Posted January 4, 2011 Hi all, I am having some problems with the jquery validate plugin. I am putting my error messages in a div, however when using the min attribute the error message is repeated everytime a keystroke is made. For example, my password field requires a min of 8 characters, so the error message appears 8 times! This is what I am using: <script> $(document).ready(function(){ $("#registerForm").validate({ rules: { username: { required: true, }, password: { required: true, minlength: 8 }, email: { required: true, email: true, } }, errorPlacement: function(error, element) { error.appendTo('#err'); } });}); </script> and to display <div id="err"> </div> and css label.error { border:solid 1px #f00; background:#F00; color:#FFF; padding:4px; text-align:center; font-size:14px; } Any help would be much appreciated Link to comment https://forums.phpfreaks.com/topic/223417-jquery-validate-custom-error-message-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.