You are reading O'Reilly XForms Essentials by Micah Dubinko. (What is this?) - Buy XForms Essentials Online

Chapter 1. Introduction to Web Forms

"In the beginning...the earth was without form, and void."

—Genesis 1:1, 2

How common are forms on the Web? Well, on a recent visit to the news site, I counted six separate forms:

As a general rule, the more interactive a web site is, the more heavily the site's designers rely on web forms, a general term for all different kinds of technologies used to gather information from users. It is easy to see why this is the case—without forms, web sites are far less interesting. Form-less web sites were the norm in the early days of the Web and provided a one-way deluge of static information, similar to the Sunday newspaper, which requires lots of navigation to get to any specific part and contains countless pages that get printed but never read.

The addition of forms to Hypertext Markup Language (HTML), the primary language used in web pages, launched an entirely new way of surfing the Web. In this book, I use the term HTML forms to refer to the form element and related markup from either HTML or XHTML. Using HTML forms, searching for information became possible on a worldwide scale. Sites such as Yahoo! quickly became the most popular "portals" of entry on the Web. Later, as developers pushed the limits of forms technology farther, web sites became even more interactive and customizable. In return for a small piece of information, such as a postal code, the browsing experience could be reshaped to include what specific information visitors were looking for—leaving out the rest. HTML forms have proven so successful in this regard that newer web technologies, such as PDF forms and Flash, have been unable to make a significant dent in their popularity.

Scientists and science fiction writers have long predicted many of the things now being made possible by web forms. For example, in a 1945 article in The Atlantic Monthly, Vannevar Bush wrote about a hypertext network he dubbed a "Memex." Even at this conceptual stage, the thought of using forms to access data came naturally, particularly in terms of drilling down through vast stores of information: "One might, for example, speak to a microphone, in the manner described in connection with the speech-controlled typewriter, and thus make his selections." How did such a technology come to be in real life?

Shortly after the initial tempering of HTML, various individuals began considering the usefulness of forms alongside hypertext. HTML Version 2.0, as presented in a document called Request for Comments (RFC) 1866, was the first time that web forms were seriously considered for standardization. That RFC captured HTML as found in common use prior to June 1994. At this point, HTML already included forms, thanks to a 1993 proposal called HTML+.

Care and maintenance of the HTML family of specifications have since been handed over to the World Wide Web Consortium, or W3C. The last non-XML-based version of HTML was version 4.01, which didn't change forms processing much. New development of the standard is taking place on a closely related technology called XHTML, where the X indicates an XML foundation. XHTML 1.0 and 1.1 were largely concerned with details of the transition to XML and ways to combine vocabularies, not with major changes to the language.

XHTML 2.0, in contrast, is making some improvements that aren't compatible with earlier flavors of HTML. The largest such change is the adoption of XForms as a replacement for the older HTML forms technology. As of August 2003, XHTML 2.0 is still under development, though it's clear that XForms will play a major role in the future of XHTML. Before we discuss XForms, however, a review of the older HTML forms technology will be helpful.