I’ve been spending the past few months trying to mold my Web 1.0 mind into something that can generate valid XHTML 1.1 without thinking twice. For the most part it’s pretty straightforward and I’ve been doing a decent job of it.

But you know what sucks? <form> tags are much less flexible than they used to be. As far as I can tell you can’t place *any* text within a form tag anymore. inputs, textareas, and selects – those are all valid, but spans and divs are not allowed!

If it’s a block-level or inline element and it’s not an element defined in the form module, it’s invalid.

The only solution is to use a <label> tag to label your inputs. That mostly works fine, but what happens when you’ve got a script that generates error text and isn’t necessarily a label? Yep, it has to go into the a label tag as well, and that usually turns out to be pretty ugly. I guess error messages should be a little ugly to grab the user’s attention, but not that ugly.

XHTML 2.0 will do away with the <form> tag entirely in favor of XForms.

The XForms draft looks pretty scary…and it’s been four years since it was written, so there’s bound to be changes and fun times ahead. Current browsers don’t even support XForms.

Of the modern browsers that do support form styling, their support is varied and inconsistent. Just try assigning a background color and border style to a checkbox. Yeah.

Anyhoo. I’m off to try and fix some forms now!

Leave a Reply