繁体   English   中英

剔除验证忽略输入字段的errorsAsTitle配置

[英]knockout validation ignores errorsAsTitle config for input field

我正在使用带有验证(1.0.2)的剔除(3.0.0),试图禁用ko-validation在包含错误时为字段生成的“工具提示”:

在此处输入图片说明

根据文档errorsAsTitle:false应该阻止显示工具提示,但是似乎忽略了false

小提琴说明问题

我当前的配置

  ko.validation.rules.required.message = 'Field(s) are required!';

  ko.validation.configure({
      registerExtenders: true,
      messagesOnModified: true,
      errorsAsTitle: false,  //<-----problem here
      insertMessages: false,
      decorateElement: true,
      errorElementClass: 'inputError'
  });

  function ViewModel() {
      this.name = ko.observable("").extend({
          required: true
      });
  };

  ko.applyBindings(new ViewModel());

在最新版本上,请使用decorateInputElement而不是decorateElement

在github上使用最新版本

http://jsfiddle.net/q4QCY/56/

Version on that cdn is old

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM