CHAPTER 11

Creating Forms

HTML enables you to create forms, web pages that provide fields in which a user can enter data before submitting the form to a server. The server processes the form, validates the data, and takes the appropriate action with the data — for example, sending it on to its destination.

image

Grasp Web Form Essentials

Create a Form

Add Text Input Controls to a Form

Add Radio Buttons to a Form

Add Check Boxes to a Form

Add a Drop-Down List of Options to a Form

Add Command Buttons to a Form

Grasp Web Form Essentials

A web form is a web page that acts as an interface enabling visitors to input information and submit it. The form appears as a web page containing input controls, such as text fields in which the user can enter their name and email address, and check boxes or option buttons that the user can select to specify choices. After filling in the form, the user submits the form by clicking the Submit button. This retrieves the data from the form and submits it to a form handler, which is usually a server page containing a script for processing the data. The form can validate data as the user enters it or when the user submits the form.

Meet the Elements You Can Use in Web Forms

Table 11-1 explains the range of input elements that HTML provides for web forms. The nearby illustration shows many of the more widely used input elements.

Table 11-1: Input Elements ...

Get Teach Yourself VISUALLY HTML and CSS, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.