Runtime Error

CustomValidityInvalidElement

The data-custom-validity attribute was used on an element that is not a HTMLInputElement, HTMLSelectElement or HTMLTextAreaElement. The data-custom-validity attribute can only be used on input, select and textarea elements.

The data-custom-validity attribute must only have a value, representing an expression that must evaluate to a string that will be set as the custom validity message. If the string is empty, the input is considered valid. If the string is non-empty, the input is considered invalid and the string is used as the reported message.

Example:

1<form>
2    <input data-bind-foo name="foo" />
3    <input data-bind-bar name="bar" 
4        data-custom-validity="$foo === $bar ? '' : 'Field values must be the same.'" 
5    />
6    <button>
7        Submit form
8    </button>
9</form>

See the docs for the data-custom-validity attribute.