Web Forms 2.0 and a bug in Opera

In doing research for a blog post I've been sitting on for months I came across the Web Forms 2.0 specification. Actually, I probably came across it while reading about how to extend Opera (vs extending Firefox).

From the why-didn't-anyone-do-this-before department, Web Forms 2.0 proposes a number of additions to the forms features of HTML including strong typing of input elements. You can add such esoteric types as "email", "time", "datetime", "url" as well as built-in validity checking with some new DOM objects.

As far as I can tell, only Opera supports these features, would be nice if Firefox and MSIE added them in as well of course.

It seems like it is safe to use some of these types today, though obviously the DOM checking cannot be relied upon without first checking to see what browser is in use. User agents which don't support the new field types simply display blank fields. Opera, which does support the types, uses native date, time pickers, and will do validity checking on other fields (so an address of epc!example.com will be flagged as invalid).

Now, these additions are in no way an excuse not to do validity checking on the server side, but they would help lessen the "weight" of pages that now rely on JavaScript to do client side validity checking, or to provide more intuitive widgets for picking dates, times, and ranges.

The bug I reported to Opera occurs with use of <input type="time">. If the time entered is not a "valid" time (perhaps 99:88) or is an acceptable time but padded with a blank (eg: 1:23), then Opera neither flags the error, nor does it pass the value on to the server when the form is submitted.

 

Here's an example form, it does not submit anything to this site. Of course, the form controls are only visible if you are using a Web Forms 2.0 capable user agent like Opera 9.

Date and Time options
:
:
:
:
:
email, url
:
:
:
Number, Range
:
:

Posted in Problems

Archives

202: Accepted Archives

Feed icon We use Feedburner to distribute our web feeds: 202 Accepted Feed

feedburner graphic
Google

Copyright 2002–2011 Artific Consulting LLC.

Unless otherwise noted, content is licensed for reuse under the Creative Commons Attribution-ShareAlike 3.0 License. Please read and understand the license before repurposing content from this site.