Wednesday, September 5, 2007

Before you buy your next car

Check out this car-buying guide at Consumerist.com

Replace HTML forms with XForms

XForms has been released by the W3C as the next step in the evolution of web forms. Replace those old HTML forms with an XML data model and presentation elements. The advantage to doing this is the ability to replace complex forms with a simpler model. The power of XForms is the ability to separate the presentation features from the data and its accompanying logic.

Because the presentation is sepatated from the behavior, the method for creating XForms is quite different from the way HTML forms are built. Some knowledge of XML is also required. However, if you have a basic knowledge of XML and have built HTML forms before, you can pick up XForms in a day.

Before getting started on where to go to learn more about XForms, let's go over a few reasons why you should be using XForms.

  • Separate form from content. If you have converted your sites to XHTML and CSS, the next logical progression is to convert your HTML forms to XForms
  • Get more features. Add multiple forms to one page - easily. Invoke AJAX like behavior - easily. Perform multiple operations in a single form. Create multiple presentations for a single form.
  • Tight integration with XML. XForms documents must be valid XML. This makes it easier to integrate with other XML technologie, such as databases, without the need for additonal scripting.

Let's learn more about XForms. A good starting tutorial is XForms for HTML Authors from the W3C. While you're there, the article on The Forms Working Group is also insightful. Next, head over to IBM for an Introduction to XForms, followed up by Use PHP to create XForms.

Because XForms is a fairly new implementation, most browsers are not equipped to render an XForm correctly. The major browsers have extensions for XForms. One place to get the Firefox extension is at Mozilla XForms.