site-media/scripts/validate-comment-form.js @ a6653f5f6733
Yeah, there are going to be a bunch of tiny commits while I test out this Bird Feeder integration, sorry.
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Thu, 15 Jan 2009 20:33:33 -0500 |
| parents | 5d5a567385bb |
| children | 7c5e0b115e6d |
$(document).ready(function() { var validator = $("#new-comment-form").validate({ errorClass: 'invalid', rules: { name: { required: true, minlength: 3, maxlength: 40 }, body: { required: true, minlength: 4, maxlength: 15000 } }, messages: { name: { required: "Please enter your name.", minlength: jQuery.format("It has to be at least {0} letters."), maxlength: jQuery.format("It can't be more than {0} letters."), }, body: { required: "Please enter a comment.", minlength: jQuery.format("It has to be at least {0} letters."), maxlength: jQuery.format("It can't be more than {0} letters."), }, }, errorPlacement: function(error, element) { error.appendTo( element.parent() ); }, }); });