Dne Mon, 10 Nov 2008 21:50:37 +0100 Ian Hickson <[EMAIL PROTECTED]> napsal/-a:

<label for="idfield">Instructions</label>
<input name="idfield" id="idfield">
<hint for="idfield">Type in dd-mm-yyyy format</hint>
<error for="idfield">Must be a valid value</error> (if error is true)

This seems excessively complicated and I'm not convinced there is really a problem to solve here. Just using plain text seems enough.

Indeed it seems enough. Although this kind of solution could improve Screen Readers' abilities to effectively interpret forms.

It could be finally clear how to code it right for both web developers and Screen Reader developers how (& what) to implement (I'm guessing here, I don't know how difficult it would be to implement such behavior). Nowadays, all kinds of hints & errors are outside the label element thus sreen readers don't read them out. That's bad. This could improve the forms & feedback accessibility in general.

I'm not saying this is the best solution, if you have another, please share. I'm proposing those changes because current situation is horrible and nobody really knows how to code it right.

An example: I'm sort of disgussed when I see how Zend Framework implements default form element wrapper-tags: dt's for labels, dd's for inputs and ul li's for errors. I think form elements (labels, inputs...) are not meant to be used in a definition list (because they aren't), errors (mostly one-line) are not meant to be in a list. Such abuse of html! Yes of course everyone does it differently, but I think people tend to do those kind of "evil" things when they don't have enough semantic tags to use. Just like <figure> solves those captionized pulled images - and replacing floated tables, divs or paragraphs - this could solve the how-the-heck-do-I-make-a-correctly-coded-and-accessible-form situation.

If I'm mistaken again, or this issue has been already discussed, I apology for wasting your time. :)
Take care,
Ollie

Reply via email to