Webforms 2.0 Implementation

Screenshot: Webforms 2.0 Implementation

Webforms 2.0 is a working draft specification for using form elements on the World Wide Web. Of the features the article discusses, I was mostly concerned with the implementation of a standard set of fields such as pattern, range and URI which could be used universally and validated the same way each time.

My interest in working with the specification in some form stems from the large use of forms on the sites I currently work with, and the numerous, (mainly legacy based) methods used to validate their content via the client. Implementing a standard specification would solve a number of problems with redundant and duplicate code, and make maintenance and redevelopment easier for all members of the team.

This Version of Webforms 2.0

The methods I have used to describe a form field's content type, and thus validate it contents on submission are similar to those discussed by Peter-Paul Koch, that is applying a new attribute type to each form element. This can then be caught by the javascript on submission and functions executed depending on the type.

On form submission, a function is executed depending on the type, and feedback is then provided if an error is found. This is currently accomplished by highlighting the erroneous field, although more verbose feedback will eventually be added.

The project currently only has a few data types in place, but I am slowly adding different types of form field which hold various types of content. I am also testing the implementation on various sites as a "catch-all" library to be included for any page that contains form fields, rather than using custom validation on each.

An example page can be viewed at experiment.beseku.com/webforms/.

The above URL also features a modified version of Cameron Adams' onChange functions for SELECT form elements, not because it is part of the Webforms 2.0 specification, but because there was nowehere else to put it.

Future Improvements

This is far from a release version, and there are currently a number of outstanding issues yet to be resolved.

All Projects

All available projects, listed in reverse chronological order.

C.V.

Although I am not taking freelance work at this time, my C.V. is available for your records.