Reputation: 495
How can I retrieve the HTML 5 'validity' status of a text box?
For instance, I have a text input with type="email"
. When the user enters the wrong value, the text box shows a red border (in Firefox browser).
How can I check the 'validity-state' of the input box?
Upvotes: 17
Views: 13117
Reputation: 328
There is an event oninvalid
for invalid input, you can register the event if you want to act on it.
Upvotes: 3