Chapter 10. XForms

Most of the technologies we have discussed to this point involve a good deal of “client-side” scripting—code to manipulate interface controls or document content. This chapter focuses on a technology designed to minimize the need for validation scripting while maximizing the portability of interface elements among different display modalities.

This chapter discusses the Firefox implementation of XForms, a World Wide Web Consortium (W3C) standard presented as an alternative technique to move structured (form-like) user entry data into served applications. The goal of an XForms implementation is to reduce the linkage between data and interface structure, reduce the amount of scripting (either at the server or at the client) required to validate entry, and expand the portability of a data model through a replaceable instance of an interface that may be customized for a specific implementation.

This chapter:

  • Covers the basic structure of an XForms design

  • Illustrates how an input form is transferred directly into XML at the server

  • Explores the conditional styling and validation features of XForms

  • Covers how we can use XML events and actions to modify interface structure

The examples will use XHTML files for the source pages served from a localhost web server such as Apache. We will code the server scripting in Personal Hypertext Processor (PHP) language.

Tip

Although Firefox supports the XForms model, you must manually install the XForms extension from the Mozilla.org development ...

Get Programming Firefox 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.