18 December 2007

XForms - what you need to know

By Andrew Clifford

If you develop or manage web sites or IT systems, you need to know about XForms.

XForms is a standard for electronic forms that is intended to replace the current standards for forms on the web (HTML forms). Although there are other competing standards, over the next few years it is likely that XForms will be widely adopted.

If you design web applications or write web pages, you need to know the differences between HTML forms and XForms.

The biggest difference is that XForms will require much less scripting.

XForms allow a lot of user interaction to be defined without scripting. For example, XForms would allow the contents of one drop-down list to be set by the value selected on another drop-down list (something that currently requires scripts in the browser). (Linked drop-down list example.)

XForms does a lot of data handling that is currently carried out by the server or by using scripts. For example, XForms can populate forms from data written into the web page or retrieved separately from the web server. XForms can write complicated XML data back to the server, without writing scripts.

XForms provides a standard way of specifying the functionality of a form. This makes it easier to write forms that work on multiple devices. (Currently this is difficult because of differences in scripting).

Unlike HTML forms, XForms support more than just web forms. For example, they can read and write data from files on a PC. For simple requirements, you could use XForms as an alternative to Visual Basic. You could use XForms for forms that have to be emailed and filled in.

Although XForms has not yet begun to replace HTML forms, it is already well supported by many products, most of which are free or open source.

Here is just a selection.

Why should you care about XForms?

Although there are other overlapping and competing standards and solutions, XForms is likely to become a significant technology over the next few years. Understanding how XForms could affect your web sites and IT systems will help you to minimise disruption and, more importantly, take advantage of new opportunities as XForms develops.