HTML forms: inputs
This course covers the HTML form element and the inputs where users type. It explains how action and method decide where data goes and which HTTP verb carries it. The name attribute turns each control into a key in params. Lessons walk through text, email, password and number inputs, textarea, and attributes such as value, placeholder, maxlength, readonly, disabled and hidden. Browser validation is treated as a convenience layer, with server validation in Rails enforcing the rules. A sign-up form ties the pieces together.
What you'll learn
- ✓How form action and method shape the request, and why every control needs a name
- ✓Text inputs and textarea: value, placeholder, maxlength and the Enter key
- ✓Email inputs, required, and why server validation in Rails still decides
- ✓What password masking protects, alongside HTTPS, hashing and autocomplete tokens
- ✓When to use type=number and when digit identifiers need text with inputmode
- ✓readonly versus disabled, autofocus, and the hidden authenticity token
form: the page starts listening
Lists, links, images, tables: everything this series has built presents content to the visitor. But think about the web you use: you search, you sign in, you check out, you post. Each of those moments is a form: the mechanism by which a page collects values from a person and sends them to a server.…
Read the full lesson free →Curriculum
7 lessonsform: the page starts listening
The form element, its action and method attributes, the name attribute, and the POST, redirect, GET pattern.
type="text": the workhorse, dissected
The anatomy of the text input: value, placeholder, maxlength versus size, textarea, and Enter submitting the form.
type="email" and required: the browser starts checking
Email inputs and required trigger native browser checks, while server validation in Rails protects the data.
type="password": what the dots do and don't protect
Password fields mask the screen only; HTTPS, server hashing, POST and autocomplete tokens cover the rest.
type="number": real numbers and impostor numbers
Number inputs with min, max and step, and why zip codes and phones need text with inputmode.
The attribute toolbox: state, limits, and hidden wiring
Shared attributes: readonly versus disabled, minlength, pattern, autocomplete tokens, autofocus, and the hidden authenticity token in Rails forms.
Putting it together: a sign-up form, honestly built
A sign-up form combining every lesson, inspected in DevTools, with server validations and careful error messages.