Forms · Lesson 12 of 16
Form validation and submission
required, min, maxlength and GET versus POST.
8 minutes1 games
HTML supports validation with required, type="email", numeric min/max and text minlength/maxlength. action is the submission URL and method is the request method. GET puts values in the URL; POST sends them in the request body.
HTML
<form> <label for="email">Email</label> <input id="email" name="email" type="email" required autocomplete="email"> <label for="seats">Seats</label> <input id="seats" name="seats" type="number" min="1" max="5" value="1" required> <button type="submit">Check</button> </form>
| Tool | Use |
|---|---|
GET | Search or reads; values in URL |
POST | Send data in request body |
Exercise
Create a required number input for age with minimum 16 and a label.
HTML
Learn more from
Played 0 of 1 games
Sign in to save your progress and earn XP.