基于本教程:http://knockoutjs.com/examples/gridEditor.html 我们在css类中有输入验证规则:
<td><input class='required' data-bind='value: name, uniqueName: true' /></td>
<td><input class='required number' data-bind='value: price, uniqueName: true' /></td>
如何设置我自己的错误消息,例如&#39;此字段中的值是必填项,且必须是数字。&#39;
答案 0 :(得分:1)
将输入的标题更改为您要提供的消息。
<td><input class='required' title='my custom error message' data-bind='value: name, uniqueName: true' /></td>
这是您关注的demo。我修改它以具有自定义错误消息
顺便说一句,这是关于html5验证的问题。它与淘汰无关。 FYI