What s wrong with HTML Forms?


What's wrong with HTML Forms?

When programming for the Web, I frequently find myself doing the same things over and over: creating a form that matches my database, preloading the fields in the form from a record, and writing the JavaScript to make my particular application work. With the help of <cfform> and some custom tags that implement cool behavior such as date pickers and pseudo-combo boxes, I can eventually get my forms to work the way I want them to, but I find myself developing the same code over and over for each new application.

In addition, my forms need to submit to a page that know exactly what the fields on my form were, and generate new forms that contain the same data with slightly different behaviors depending on what stage of workflow the data is in. For example, creating a press release page, where the person who assigns the task of writing, the author, the editor, and the person responsible for final approval all see the same data, but can edit different parts of it, requiring a lot of conditional logic to make the form do all the different things its got to do (or redeveloping the form four times.)

The idea of XForms is to take what's been learned from years of using HTML forms, and create a new type of forms that's more generally applicable. The primary improvements of XForms, as outlined in the W3C's XForms Recommendation (see http://www.w3.org/TR/XForms/) are:

  • Separate Form From Data. The data used to load a form's data can exist completely separately from the form's implementation, and is an XML document. This is similar to using CSS Style sheets and custom styles to separate the content of a document from the specifics of its implementation.

  • Strong Typing. HTML forms submit everything as text; defining your own types allows better and more accurate form validation.

  • XML submission. XForms can submit data to the server as an XML document, which can be stored or processed as needed.

  • Less Use of Scripting. You can define validation rules and cross-control behaviors in XForms that don't require any scripting in the form.

  • Other Improvements, including re-use of schemas, the ability to add your own schemas to the language, internationalization, accessibility, and support of many devices including phone systems, handheld devices, and accessible devices such as screen-readers.



Advanced Macromedia ColdFusion MX 7 Application Development
Advanced Macromedia ColdFusion MX 7 Application Development
ISBN: 0321292693
EAN: 2147483647
Year: 2006
Pages: 240
Authors: Ben Forta, et al

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net