HTML5
Jump to navigation
Jump to search
Validation
Use the pattern attribute
<form action="/action_page.php"> Country code: <input type="text" name="country_code" pattern="[A-Za-z]{3}" title="Three letter country code" required> <input pattern=".{3,}" required title="3 characters minimum"> <input pattern=".{5,10}" required title="5 to 10 characters"> <input type="submit"> </form>
https://stackoverflow.com/questions/17664537/html5-validation-easy-way-to-have-real-time-validation