Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Introduction to HTML Level One ยท Lesson 8 of 11

Module Seven

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
8
Module 7 - HTML Forms Fundamentals

Module 7: HTML Forms Fundamentals

Module Introduction

In the previous module, we learned how to create tables.

In this module, we will learn about forms. Forms allow people to enter information on a webpage. For example, when you register for a game, fill out a school form, or sign up for a website, you are using a form.


Lesson 1: What is a Form?

A form is a special area on a webpage where users can type information or make choices.

Forms help websites collect information from visitors.

Fun Example

Imagine your teacher gives you a paper asking for your name, age, and favorite subject. That paper is a form. HTML forms work the same way.


Lesson 2: Creating a Form

We create forms using the <form> tag.

<form>

</form>

Everything inside the form tag becomes part of the form.


Lesson 3: Text Input Fields

Text fields allow users to type information.

<form>

Name:
<input type="text">

</form>

Output

Name: [____________]

Fun Example

Think of a text box as an empty notebook page waiting for someone to write on it.


Lesson 4: Radio Buttons

Radio buttons allow users to choose only one option.

Favourite input type="radio"> Red
<input type="radio"> Blue
<input type="radio"> Green

You can select only one color.

Fun Example

Imagine choosing one ice cream flavor. You can only pick one flavor at a time.


Lesson 5: Checkboxes

Checkboxes allow users to select multiple options.

My Hobbies:

<input type="checkbox"> Football
<input type="checkbox"> Reading
<input type="checkbox"> Drawing

You can choose one, two, or all the hobbies.

Fun Example

Imagine choosing toppings for a pizza. You can select as many toppings as you want.


Lesson 6: Dropdown Lists

Dropdown lists allow users to choose from a list of options.

<select>

<option>Primary 4</option>
<option>Primary 5</option>
<option>Primary 6</option>

</select>

Clicking the dropdown shows all available choices.


Lesson 7: Submit Buttons

A submit button sends information from the form.

<input type="submit" value="Send">

Fun Example

Think of dropping a completed form into your teacher's collection box. The submit button does the same thing.


Lesson 8: Reset Buttons

A reset button clears everything entered into the form.

<input type="reset" value="Clear">

If you make a mistake, the reset button helps you start again.


Complete Example

<!DOCTYPE html>
<html>

<head>
    <title>Student Registration Form</title>
</head>

<body>

<h1>Student Registration Form</h1>

<form>

Name:
<input type="text">

<br><br>

Gender:

<input type="radio"> Boy
<input type="radio"> Girl

<br><br>

Hobbies:

<input type="checkbox"> Football
<input type="checkbox"> Reading

<br><br>

Class:

<select>
    <option>Primary 4</option>
    <option>Primary 5</option>
    <option>Primary 6</option>
</select>

<br><br>

<input type="submit" value="Submit">

<input type="reset" value="Reset">

</form>

</body>

</html>

Class Exercise 1

Fill in the blanks:

  1. _____ creates a form.
  2. _____ allows users to type text.
  3. _____ allows only one choice.
  4. _____ allows multiple choices.
  5. _____ creates a dropdown list.

Class Exercise 2

Create a form that asks for:

  • Your Name
  • Your Favorite Sport
  • Your Favorite Food

Add a Submit button.


Class Exercise 3

Fix the missing tags:

<_____>

Name:
<input type="text">

<input type="submit" value="Send">

</_____>

Mini Project

Create a webpage called schoolregistration.html.

Include:

  • A heading called "School Registration"
  • Name field
  • Age field
  • Gender radio buttons
  • Favorite Subject dropdown
  • Submit button
  • Reset button

Challenge Exercise

Create a "Favorite Things Survey" form.

Include:

  • Name field
  • Favorite Color (radio buttons)
  • Favorite Hobbies (checkboxes)
  • Favorite School Subject (dropdown)
  • Submit button

Module Summary

  • Forms collect information from users.
  • The <form> tag creates a form.
  • Text inputs allow typing.
  • Radio buttons allow one choice.
  • Checkboxes allow multiple choices.
  • Dropdown lists provide several options.
  • Submit buttons send information.
  • Reset buttons clear the form.

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’