如何在Jquery表单验证插件中将"此字段是必需的"的常规消息更改为"このフィールドは必须です"?可以使用以下代码更改消息的颜色:
<style type="text/css">
label.error {color: red;}
</style>
Run Code Online (Sandbox Code Playgroud)
但是如何改变内容呢?
我想更改所有"此字段是必填的"消息.
我想将所有"必填"消息更改为"このフィールドは必须です".
$(".selector").validate({
rules: {
name: "required",
email: {
required: true,
email: true
}
},
messages: {
name: "Please specify your name",
email: {
required: "We need your email address to contact you",
email: "Your email address must be in the format of name@domain.com"
}
}
})
Run Code Online (Sandbox Code Playgroud)
仅更改特定规则和特定元素的特定消息.
我写
messages: {
required:"????????????"
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
javascript jquery localization jquery-plugins jquery-validate