Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
到目前为止,我一直在使用jQuery 验证插件和之前定义的字段。现在我正在使用动态表单。字段的验证需求由其类映射(例如“ required ”),但我看不到如何自定义 jQuery 验证抛出的消息。
你可以像这样添加你的消息。
$.extend($.validator.messages, { required: "your msg", email: "your email msg", digits: "your digits msg" });
见setDefaults
$.validator.messages.required = "My new, default required message!";
设置默认值