Validation lab

All fields are required unless marked optional.



required: leave it empty to see valueMissing.



type="email": type sam.example.com to see typeMismatch.



setCustomValidity(): type a different address to see customError.



type="url": a URL needs a scheme, such as https://.



pattern: 5 digits, or 5, a hyphen and 4. Try 9209 or 920931.



min="1" max="12", step 1: try 0, 13 and 2.5. Where the browser allows it, type 1e to see badInput.



step="0.01": 12.50 is fine, 12.505 is a stepMismatch.



minlength="20" maxlength="200": type a few words to see tooShort; the box stops you at 200.