Chapter 16. Adding Forms to Pages

Awebsite is a great way to brand your company, announce a new product, post late-breaking news, or rant about the state of the world. But all that’s one-way communication, and you may want to interact with your audience more directly—to get feedback on your product or company, for example, or to gather vital statistics from customers.

If you want to receive information as well as deliver it, it’s time to add forms to your website design repertoire (see Figure 16-1 for a simple example). For instance, if you want site visitors to sign up for your email newsletter, build a form to collect their names and email addresses. Accepting lunch reservations for Cafe Soylent Green? Create a form to get the details of date, time, and number of guests. Whatever type of information you need to collect on your site, Dreamweaver’s form objects make the task easy.

Form Basics

A form begins and ends with the HTML <form> tag. The opening tag (<form>) indicates the beginning of a form and sets its properties, and the closing tag (</form>) marks the form’s end.

You put form elements that your visitors interact with—radio buttons, text boxes, pull-down menus, and so on—between those two tags. It’s perfectly OK to include other HTML elements inside a form, too. In fact, your visitors would be lost if you didn’t add (and format) text that explains each element’s purpose. And if you don’t use Cascading Style Sheets to lay out your form in an organized way, it can quickly become ...

Get Dreamweaver CC: The Missing Manual, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.