How to do multiple input checks using HTML5?

HTML5 provides an alternative to validating JavaScript using regular expressions. But I want to add some checks to one input field and according to it it should show the message.

For example.

<input type=passowrd name=passowrd/>

Here the password field should contain the following check with the message. enter image description here

0
html5 validation
source share
2 answers

I am afraid that this cannot be done only with HTML (no, not even HTML5).

You must use JavaScript to achieve this.

+1
source share

Limit checking is for only one error message per input field. A way around this is to combine validation messages.

 password.setCustomValidity(password.validationMessage + ' At least one capital letter'); 

The downside is that you cannot add html, so all messages will be put in a string.

0
source share

All Articles