我在用
$("#myForm").validate({
errorLabelContainer: "#messageBox",
rules: {
name: "required",
checkedUserId: {
required: true
},
url: {
url: true
},
messages: {
name: "Please enter name ." ,
checkedUserId: "Please select at least one user"
},
errorElement: "div",
wrapper: "div",
errorPlacement: function(error, element) {
offset = element.offset();
error.insertBefore(element)
error.addClass('message'); // add a class to the wrapper
error.css('position', 'absolute');
error.css('left', offset.left + element.outerWidth());
error.css('top', offset.top);
}
}
});
它向我显示默认消息“此字段是必需的”。我想显示“请输入姓名”而不是消息。
如果您需要更多信息,请告诉我。