|
|
|
|
|
by test6554
459 days ago
|
|
We have <input> and <label for=""> elements, but what about <validation for="" condition="" message=""> elements? Condition could be a wide range of possible built-in validation functions or a custom regex or js function. Instead of adding all these validation attributes to <input> elements you could have zero or more <validation> elements, each with their own message. The message could automatically appear when its conditions fail. Unless you call preventDefault() inside an "invalid" event handler. The invalid event could have a list of all "validations" for that element and you could check their status via js, disarm/ignore them individually, or get their messages etc. |
|
1: https://developer.mozilla.org/en-US/docs/Learn_web_developme...