basterebbe
codice:
... data-error="use me to describe this error" oninvalid="this.setCustomValidity(this.getAttribute('data-error'))" ...