zondag, mei 29, 2005

XForms - The Next Generation of Web Forms

If you don't know anything about HTML or web development you better skip this article and move to the next article "I'm a Sony addict".

HTML evolved in four main versions, that is, HTML 1, 2, 3 and it stopped at HTML 4. For XML compliancy they introduced XHTML 1 and are working towards XHTML 2 at this moment. What will bring XHTML 2? Are they evolving in the direction we expect? Let's first outline what we want, and than check whether the new standard does have similar things in mind.

What I personally think would be of great benefit for web developers as well as for browser users, are improved forms. As today we have textfields, textareas, checkboxes, radio buttons, submit buttons and combo boxes as input controls. We should extend the possibilities of these input controls to meet the needs of modern forms to support e-commerce projects even better. Nowaddays a lot of javascripting is done to validate each input control. Because of the general dislike of JavaScript, different levels of programming and the instability among different browsers, we should move away from JavaScript validation by putting intelligence in the input controls embedded in the browser.

Take TextField.restrict as an example. This is a textfield property supported by Macromedia Flash to allow only a certain set of characters to be entered in a (Flash-only) textfield. This would come in handy for basic e-mail address validation, or for validation of simple input values like 'firstname' and 'lastname'. Using regular expressions a lot of intelligence could be added to textfields. But before implementing new stuff we should clean up, or finish up the current HTML standard.

Take a 'textarea' for example. Why can't we specify the maximum number of character to be entered? This is possible with normal textfields, but not with textareas. Someone just forgot, or is there a good reason behind it?

In the current climate of XML, we should adapt some fields to be more XML compliant. Why can't we enter a textfield as follows. It should be of great benefit for XML parsers.

<input type="text>Here comes the input value</input>

The same applies to checkboxes and radio buttons.

XUL or XAML?

Maybe it's not such a good idea extending the old HTML specification. We could switch over to another GUI markup language instead. Take XUL. XUL is an open-source markup language currently used for desktop applications like Firefox. It has way more possibilities than HTML and therefor a good alternative to the current HTML.

Microsoft wouldn't be Microsoft if they didn't develop an alternative... XAML is their answer to XUL. XAML will be used to define the GUI for Windows Longhorn. It will also support two-dimensional graphics as an equivalent to SVG, a W3C standard.

As today, there are no rumours replacing HTML or XHTML by XUL, XAML or another GUI language. The good news is that W3C, who develops markup standards, is introducing certain XUL/XAML features in their XHTML 2 specification. Markup languages developed for desktop applications do not serve the same purpose as markup languages for websites. Websites must work with different user settings and render engines like the one of Internet Explorer and Mozilla while XAML and XUL only have to work with one render engine. That's a good reason defining another standard, XHTML 2, specially focused on markup for websites.

XFORMS

Going through the XHTML 2 specification I'm happy to read that W3C is planning a major update towards forms, called XFORMS. The specification of forms hasn't been reviewed since 1993, so a lot has to be done. XFORMS provides support for several built-in datatypes like e-mail addresses, ID numbers (credit card numbers,...). They are even considering using patterns for input fields but come to the conclusion that introducing regular expressions (patterns) would be a step too far for XHTML 2. The XFORM specifications also mentions the introduction of a new form attribute, the validation boolean. If this boolean is set to 'true', the form is ready to be submitted.

But there is more! The following images show how new input controls could be rendered by browsers:




Conclusion

W3C is doing it's best improving browsing experience and making life easier for users as well as web developers. Both would benefit from the new specifications. The question is, how long will it take before this recommendation is implemented by major browsers? And how is backward compatibility going to be handled? One thing is sure, web developers will have their hands full adapting websites to support the new standards. Also browser developer are facing a major upgrade in their render engine (resulting in new security threads). Together with CSS3, XHTML2 will be an important step for the web. Exciting!

More at: http://www.w3.org/MarkUp/Forms/

3 Comments:

At 4:04 a.m., Anonymous Anoniem said...

Bart, wonderful article; sorry, though... my eyes started to glaze over at "HTML 2".... Not my speed, ya know?

:)

 
At 7:25 a.m., Anonymous Anoniem said...

"I just came across your blog about Ebay Powersellerand wanted to drop you a note telling you how impressed I was with the information you have posted here. I also have a web site & blog about **keyword** Ebay Powerseller so I know I'm talking about when I say your site is top-notch! Keep up the great work, you are providing a great resource on the Internet here!

 
At 12:15 p.m., Anonymous Anoniem said...

www.getipodsforfree.com has this cool thing where if you just sign up and do an offer, you can get a free ipod

 

Een reactie posten

<< Home