topskill.dev
CoursesTracks
0
All courses/Introduction to HTMLChoice Controls: Select Training Modes
Forms
5 / 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

Choice Controls: Select Training Modes

The crew can practise several capabilities but must reserve only one training window. The completed form in index.html uses checkboxes for the first decision and radios for the second. Run it and compare what stays selected.

Read the code

html
<label><input type="checkbox" name="mission" value="flight" /> Flight</label>
<label><input type="radio" name="window" value="dawn" checked /> Dawn</label>

Checkboxes are independent. Radios in the same form with the same name form one group. Each choice needs a distinct value so the receiving service can tell the answers apart. Wrapping an input in a <label> connects the text without for and id.

A <fieldset> groups related controls. Its first child, <legend>, names the decision the group asks the visitor to make. checked marks the initial selection, not a permanent lock.

Try the preview

Run the demo. Turn on more than one practice mission, then choose a training window; selecting a new radio choice replaces the old one.

Check your page

Select Flight and Shield together, then switch from Dawn to Night. Both checkboxes should stay selected; only Night should remain selected in the radio group. You can change the default by moving checked to Midday, Run, then restore Dawn.

Next

Continue to Plan a Supply Pickup. You will recreate the same idea from a smaller starter file.

Files
  • ⋄index.html
Loading editor…