Skip to content
BENIBIX Learn

HTML Form

Development🌐 Web DevelopmentBrowser Code

Also known as Web Form, Form, <form>

The part of a page where people type or pick things to send to a server.

Think of it like

Think of it like a paper form at the doctor's. You fill in the boxes and hand it to the desk.

Example

Lucy's sign-up form asks for an email and a password. The browser stops her from sending it with the email box empty.

Why it matters

Forms are how most data gets into a website. Sign-ups, orders and searches all start here.

Definition

An HTML form is a part of a page that collects what people type. Sign-ups and search boxes are forms. It is made of fields such as text boxes, check boxes and drop-down lists, plus a button to send. When sent, the browser packs up the values and posts them to a server address. The browser can check simple rules first, like a field being required. The server must still check everything again.

Example code

html
<form action="/signup" method="post">
  <input type="email" name="email" required>
  <button>Sign up</button>
</form>
One required email box and a button that sends it to /signup.

Common mistake

Leaving out the <label> for each field. Screen readers then cannot tell people what a box is for.

Key takeaways

  1. 1
    Fields and a button. Type or pick, then send.
  2. 2
    Browser checks first. Simple rules like required.
  3. 3
    Server checks again. Never trust the browser alone.

Learn it properly