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

Project 2: Create a Contact Us Form (Structure)

You have practiced the controls separately. Apply them to the Riverlight Community Hall contact page for room bookings, volunteering, and accessibility requests.

The starter in index.html supplies the Contact Us heading. Add a labeled form below it. The example /contact path has no receiving service here; this preview does not deliver messages to the hall.

One idea: labels make a form usable before it is styled

A label tells people and assistive technology what a control means. Connect it with matching for and id values; repeat that pattern for inputs, textareas, and selects. Placeholder text is only a hint inside a field: it can disappear as someone types and does not replace a label.

html
<label for="workshop">Workshop</label>
<select id="workshop" name="workshop">
    <option value="clay">Clay modeling</option>
    <option value="print">Printmaking</option>
</select>

The browser can require an answer with required. Put the controls inside one <form method="post">. Each field also needs a non-empty name, which becomes its key in the submitted data. An id alone does not send an answer. POST puts data in the request body; a real site still needs HTTPS and a receiving service that validates the answers.

Check your page

Edit index.html, Run to inspect each new field, then Submit to check your tasks. With Name empty, clicking Send Message should trigger the browser’s required-field prompt rather than send a request. Do not submit a completed form: /contact is only an example destination. If clicking a label does not focus its control, compare its for and id values.

Your Task

  1. Add a <form method="post"> below the heading.
  2. Add a text input with name="name" inside the form.
  3. Add an email input with name="email" inside the form.
  4. Add a Message <textarea name="message"> inside the form.
  5. Mark the Name input required.
  6. Mark the Email input required.
  7. Add a Topic <select name="topic"> with distinct values for room booking, volunteering, and accessibility.
  8. Add a submit button with visible action text inside the form.
  9. Connect a visible Name label to the text input with matching for and a unique id.
  10. Connect a visible Email label to the email input in the same way.
  11. Connect a visible Message label to the textarea in the same way.
  12. Connect a visible Topic label to the select in the same way.

The next lesson starts with this completed reference form. If you changed the wording, carry your version forward and keep its fields as you add reply preferences.

Hint 1
1 / 2
HINT 1

Each input should have a matching label using for/id.

HINT 2

Use method="post" for contact form submission.

Files
  • ⋄index.html
Loading editor…