简体   繁体   中英

knockout validation ignores errorsAsTitle config for input field

I'm using knockout (3.0.0) with validation (1.0.2), trying to disable "tooltips" which ko-validation generates for a field when it contains an error:

在此处输入图片说明

Based on documentation , errorsAsTitle:false should prevent tooltips from displaying, but it seems to ignore false .

Fiddle illustrating the issue

My current configuration

  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

Works with latest version on github

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

Version on that cdn is old

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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