Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    </>HTML

    Document foundations

    • What is HTML?
    • Metadata and language
    • Attributes and character references
    • Headings, paragraphs and formatting

    Content and media

    • Links
    • Images
    • Lists
    • Tables
    • Responsive images and media

    Forms

    • Forms and inputs
    • Grouping form controls
    • Form validation and submission

    Structure and accessibility

    • Semantic HTML
    • Keyboard and screen-reader access
    • Disclosure with details
    • Project: your profile page
    HTML

    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>

    Important

    Browser validation improves usability, not server security. Validate again on the server. POST alone is not encryption; secure transport needs HTTPS. This preview demonstrates fields, not a registration service.

    Interview question

    Is an input without name submitted?

    ToolUse

    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

    • MDN: HTML referencedeveloper.mozilla.org
    • web.dev: formsweb.dev

    Played 0 of 1 games

    Sign in to save your progress and earn XP.

    PreviousGrouping form controlsNextSemantic HTML
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.