O'Reilly logo

HTML & CSS: Design and Build Websites by Jon Duckett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7

FORMS

  • How to collect information from visitors
  • Different kinds of form controls
  • New HTML5 form controls

Traditionally, the term ‘form’ has referred to a printed document that contains spaces for you to fill in information.

HTML borrows the concept of a form to refer to different elements that allow you to collect information from visitors to your site.

Whether you are adding a simple search box to your website or you need to create more complicated insurance applications, HTML forms give you a set of elements to collect data from your users. In this chapter you will learn:

  • How to create a form on your website
  • The different tools for collecting data
  • New HTML5 form controls

image

WHY FORMS?

The best known form on the web is probably the search box that sits right in the middle of Google's homepage.

In addition to enabling users to search, forms also allow users to perform other functions online. You will see forms when registering as a member of a website, when shopping online, and when signing up for newsletters or mailing lists.

image

FORM CONTROLS

There are several types of form controls that you can use to collect information from visitors to your site.

ADDING TEXT:

Text input (single-line)

Used for a single line of text such as email addresses and names.

Password input

Like a single ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required