HTML5 Validation

Following example states the use of HTML5 control form validation.

<!DOCTYPE html>
<html>
<body>
<h1> HTML5 Form Validation </h1>
<hr>
<form name=f1>
Enter name: <input type="text" pattern="[a-zA-Z]+" title="Your name without space" required /> </br>
Email id: <input type="email" required /> </br>
WebAddress: <input type="url" required/> starts with http:// </br>
Phone number: <input type="tel"  pattern="^\d{2}-\d{10}" required/> [e.g:91-9876543210]  </br>

Enter date: <input type="date"> </br>
Enter Age: <input type="number" size="6" name="age" min="18" max="99" value="21"></br>

<input type="submit" />
</form>
</body>
</html>

Output of the above page is:

Thank you for reading!

Share

1 thought on “HTML5 Validation”

  1. Magdalena Fullerton

    You made some really good points there. I checked on the internet to find out more about the issue and found most individuals will go along with your views on this site.

Comments are closed.

Share
Scroll to Top