Chapter 7. Creating Forms

In This Chapter

  • Adding form to your pages

  • Creating input and password text boxes

  • Building multi-line text inputs

  • Making list boxes and check boxes

  • Building groups of radio buttons

  • Creating buttons

XHTML gives you the ability to describe Web pages, but today's Web isn't a one-way affair. Users want to communicate through Web pages, typing in information, making selections from drop-down lists, and interacting, rather than simply reading. In this chapter, you learn how to build these interactive elements in your pages.

You Have Great Form

There's one more aspect to XHTML that you need to understand — the ability to make forms. Forms are the parts of the page that allow some user interaction. Figure 7-1 shows a page with all the primary form elements in place.

The form demo (or formDemo.html on the CD-ROM, if you're playing along at home) is an example of all the main form elements in XHTML. In this chapter, you discover how to build all these elements.

Tip

You can create forms with ordinary XHTML, but to make them do something, you need a programming language. Book IV explains how to use JavaScript to interact with your forms, and Book V describes the PHP language. Use this chapter to figure out how to build the forms and then jump to another minibook to figure out how to make them do stuff. If you aren't ready for full-blown programming yet, feel free to skip this chapter for now and move on to CSS in Books II and III. Come back here when you're ready to make forms ...

Get HTML, XHTML, and CSS All-In-One Desk Reference For Dummies® 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.