login
You can use setCustomValidity function when oninvalid event occurs.
setCustomValidity
oninvalid
Like below:-
To clear the message once you start entering use oninput="setCustomValidity('') attribute to clear the message.
oninput="setCustomValidity('')