topskill.dev
CoursesTracks
0
All courses/Introduction to HTMLProject 2 - Contact Us Form Actions
Project - Contact Us Form
2 / 3
← 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

Project 2 - Contact Us Form Actions

Project 2: Contact Us Form (User Actions)

The Riverlight form can now collect a message. Keep its supplied Name, Email, Topic, Message, and submit controls; they are earlier work, not new task credit.

In index.html, add interests, an optional phone number, one preferred reply method, and consent before the existing button. These choices help a future receiving service route the request; HTML alone will not process it.

One idea: names define a radio group

Checkboxes allow several independent answers. Add an optional phone field so a visitor who requests a call can supply a number; type="tel" offers a phone-friendly keyboard but does not check the number’s format. Radio buttons share one name when they represent a single decision.

html
<fieldset>
    <legend>Preferred reply method</legend>
    <input type="radio" id="reply-email" name="reply-method" value="email" />
    <label for="reply-email">Email</label>
    <input type="radio" id="reply-phone" name="reply-method" value="phone" />
    <label for="reply-phone">Phone</label>
</fieldset>

Use a separate checkbox for consent and add required when it must be accepted before sending. Leave it unchecked so the visitor makes the choice. Every checkbox and radio needs visible label text, just like a text field. Give the choices non-empty name and value attributes; unchecked checkboxes are not included in submitted form data.

Check your page

Run the form. You should be able to select several interests but only one reply method. Try to submit without consent: the browser should stop the request. If both reply options remain checked, make sure they use the same name. This HTML-only preview has no server to deliver messages or check that someone choosing a phone reply also supplied a number.

Your Task

  1. Add two optional interest checkboxes with name="interests" and values booking and volunteering.
  2. Add an optional phone input (type="tel") with a non-empty name and visible connected label.
  3. Add two reply-method radio buttons with values email and phone.
  4. Give both reply-method radios the same non-empty name so only one stays selected.
  5. Add a separate required consent checkbox with name="consent" and value="yes"; leave it unchecked.
  6. Give both interest checkboxes visible labels, wrapping each input or using matching for and id.
  7. Give both reply-method radios visible labels in the same way.
  8. Give the consent checkbox a visible label explaining agreement to be contacted.

Submit to check the new choices. This completes the contact page’s HTML; it does not configure delivery or store consent. In the next module, you will use the hall setting again to study media rather than keep extending this form.

Hint 1
1 / 2
HINT 1

Use checkboxes for multiple interests and radio buttons for one preferred contact method.

HINT 2

Ensure submit control is inside the form.

Take the Quiz →
Files
  • ⋄index.html
Loading editor…