Intern Track Roadmap

HTML forms: selections

This course covers the HTML controls that let visitors choose values instead of typing them. It explains checkboxes, checkbox groups, radio buttons and select menus, plus optgroup, multiple and datalist. Each lesson shows what the browser submits, including the silence of unchecked boxes, and how Rails parses the result into params. It also covers pre-selected states with checked and selected, placeholder options, and the hidden input trick. A final preferences form combines every control, and the course stresses that server validations still judge all input.

What you'll learn

  • ✓How to pick a selection control by how many options exist and how many may be chosen
  • ✓Why unchecked checkboxes submit nothing and how Rails pairs them with a hidden input
  • ✓How the [] name suffix turns repeated keys into arrays in Rails params
  • ✓How radio groups share a name and why a default should be pre-checked
  • ✓How select options separate the visible label from the submitted value
  • ✓When to use optgroup, multiple and datalist, and why server validation still matters
Free preview · Lesson 1 4 min read

Choosing, not typing

The previous course gave your forms text boxes, and text boxes have a weakness you will fight for your whole career: people type anything into them. Ask for a country and you'll receive "Brazil", "brasil", "BR", "Brasil 🇧🇷", and "brazl". Ask "do you accept the terms?" and a text box invites an…

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...