Custom messages
Sometimes it’s better to provide own translation instead of browser’s defaults which are automatically set to user’s language. You might want to do set custom messages for:
- consistent translation - user might change app’s language
- more specific error messages
This can be achieved with input-validity
by using message-*
attributes.
It’s also common to use multiple validation rules, for example required email field. For that we will use required
with message-value-missing
and type="email"
with message-type-mismatch
.
You can find complete list of supported message-*
attributes here.