Chapter 14. Forms

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 you may want to build your business by gathering 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 14-1 for a simple example). Say you want your site visitors to sign up for your email newsletter. You’d build a form to collect their name and email address. 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; the closing tag (</form>), of course, marks the form’s end.

You put form elements that your visitors interact with between those two tags—radio buttons, text fields, and pull-down menus are just a few options you can choose from. 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 a table or Cascading ...

Get Dreamweaver CC: The Missing Manual 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.