0% found this document useful (0 votes)
9 views1 page

HTML Validations Guide for Forms

The document outlines various HTML validations that can be implemented, including required fields, email format, and minimum/maximum length constraints for inputs like passwords. It provides examples of HTML code for a password input field with a specified character pattern and requirements. Additionally, it includes patterns for validating only digits and word characters.

Uploaded by

ROHIT JAIN
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

HTML Validations Guide for Forms

The document outlines various HTML validations that can be implemented, including required fields, email format, and minimum/maximum length constraints for inputs like passwords. It provides examples of HTML code for a password input field with a specified character pattern and requirements. Additionally, it includes patterns for validating only digits and word characters.

Uploaded by

ROHIT JAIN
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HTML Validations:

By using HTML, we can perform the following validations

1. required
2. email
3. min and max length
Eg password should be minimum 5 characters and maximum 10 characters

Eg
<label for="password">Password:</label>
<input type="password" name="password" id="password" pattern=".{5,10}" placeholder="your
password" required title="5 to 10 characters">

Pattern for only digits:[0-9]{5,10}


Pattern for only word characters:\w{5,10}

nd
DURGASOFT, # 202, 2 Floor, HUDA Maitrivanam, Ameerpet, Hyderabad - 500038,
20  040 – 64 51 27 86, 80 96 96 96 96, 92 46 21 21 43 | [Link]

You might also like