我正在为 textarea 使用 charcount 插件
http://cssglobe.com/jquery-plugin-simplest-twitterlike-dynamic-character-count-for-textareas/
和jquery表单验证
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
一切正常,但代替错误消息字符计数即将到来,希望很清楚。任何人都可以帮助我解决这个问题。在此先感谢。代码示例 http://jsfiddle.net/rashvish18/gF7ua/1 /
这是我正在使用的代码
$(document).ready(function(){
$("#story").charCount({
allowed: 250,
warning: 20,
counterText: 'characters remaining: '
});
//$("#storyform").preventDefault();
$("#storyform").validate({
rules: {
place:"required",
story: "required"
},
messages: {
story: "Please write your story",
place: "Please write your place"
},errorElement: "span",
wrapper: "span" // a wrapper around the error message
});
});