topskill.dev
CoursesTracks
0
All courses/Introduction to HTMLForm Basics: Join the Meridian Relay
Forms
1 / 11
← Introduction to HTML
○What Is HTML? See Tags in Action○Build the Meridian Signal○Complete HTML5 Page Structure○Build a Complete HTML5 Page✦Module Quiz
○Heading Hierarchy: H1 and H2○Extend the Signal Brief○Paragraphs and Inline Tags○Write Meridian's Survey Notes○List Types: Steps, Items, and Terms○Build a Crew Member Loadout○Challenge: Transmit a Rescue Signal✦Module Quiz
○Hyperlinks○Links between project files○Images○Applying Styles to HTML✦Module Quiz
○Div and Span○HTML Tables○Classes and IDs○Review: Structured Profile✦Module Quiz
○Project 1 - Visiting Card Structure○Project 1 - Visiting Card Actions✦Module Quiz
○The Head Element and Page Title○Meta Tags○HTML Entities✦Module Quiz
●Form Basics: Join the Meridian Relay○Build a Night-Shift Check-In○Input Types: Build a Mission Profile○Record Beacon Maintenance○Choice Controls: Select Training Modes○Plan a Supply Pickup○Response Controls: Send a Mission Reply○Build a Rescue Dispatch Report○Form validation and submission○Challenge: Send an Emergency Beacon✦Module Quiz
○Project 2 - Contact Us Form Structure○Project 2 - Contact Us Form Actions✦Module Quiz
○Embedding Video○Embedding Audio○Iframes✦Module Quiz
○Semantic HTML Tags○Details, Figure, and Figcaption○A keyboard-friendly page✦Module Quiz
○Project 3 - Resume Semantic Structure○Project 3 - Resume Links and Actions✦Module Quiz

Form Basics: Join the Meridian Relay

You can now name and describe a page. Forms let a visitor give answers. The completed index.html shows the Meridian Relay intake form; Run it and compare the visible labels with their corresponding inputs.

Read the code

html
<label for="crew-contact">Crew contact</label>
<input type="text" id="crew-contact" name="crew-contact" required />

The label’s for value matches the input’s unique id, so clicking the label focuses the right field. id connects the label; name identifies the answer when a form is submitted. For example, name="crew-contact" gives that answer the key crew-contact.

<form> groups the answers. Its action is the destination and method="post" puts answers in the request body; neither creates a receiving service. A password input masks what you type, but does not encrypt it. Use made-up practice values here. required makes the browser ask for a value before submission. It is a boolean attribute: its presence turns the feature on. required="false" still requires a value; remove the attribute to make the field optional. Later controls use the same presence rule for checked and selected.

An input is a void element, so it has no closing </input>. A button has opening and closing tags because its action text goes between them. Use type="submit" explicitly for the button that sends a form.

Try the preview

Run the page and click each label. The matching field receives focus. The button is the form’s clear submit action. The /relay-intake address is illustrative; this preview has no server to receive a real request.

Check your page

Notice that each visible label names a different field. As an optional experiment, change the Crew contact label text, Run, and click it again: the connection still works because for and id have not changed. Restore the text before moving on. Do not submit real details.

Next

Continue to Build a Night-Shift Check-In. You will recreate the same idea from a smaller starter file.

Learn more

MDN’s official documentation explains how a label is associated with its form control and why that connection matters for usability and accessibility. Read MDN’s reference for the <label> element when you want to go further.

Files
  • ⋄index.html
Loading editor…