setCustomValidity

external fun setCustomValidity(error: String)(source)

The setCustomValidity() method of the HTMLObjectElement interface sets a custom validity message for the element.

MDN Reference