[whatwg] Context help in Web Forms

Charles McCathieNevile chaals at opera.com
Tue Jun 3 09:39:32 PDT 2008


On Mon, 02 Jun 2008 09:40:55 -0300, Matthew Paul Thomas  
<mpt at myrealbox.com> wrote:

> Ian Hickson wrote on 27/05/08 07:47:
>>
>> On Mon, 12 Nov 2007, Matthew Paul Thomas wrote:
>>
>>> On Oct 30, 2007, at 6:01 PM, Ian Hickson wrote:
>>>>
>>>> On Mon, 13 Jun 2005, Matthew Thomas wrote:
>> ...
>>>>> Many applications provide inline help which is not a label, and the
>>>>> same attributes would be appropriate here: <div rel="help"
>>>>> for="phone-number"><p>The full number, including country code.</p>
>>>>> <p>Example: <samp>+61 3 1234 5678</samp></p></div>
>>>>
>>>> How would UAs use this?
>>>
>>> UAs likely wouldn't, but scripts could. For example, a form might
>>> include sparing help by default, with a style sheet hiding more
>>> exhaustive help (as indicated by rel="help"). Then a script could add a
>>> small help button after each control that has associated help (i.e.  
>>> each
>>> control with name="x" where there exists an element on the page with
>>> rel="help" for="x"). When a control's help button was clicked, the
>>> control's help would be shown.
>> ...
>> The data-* attributes are intended for scripts like this.
>> ...
>
> The disadvantage of using a data-* attribute is that more kinds of
> mistakes would be undetectable by a validator. It would have no idea
> that (a) the value of the attribute must be the ID of an element
> elsewhere in the document, and (b) each value must be unique within the
> document.

Indeed.

There is an attribute for this called contexthelp or something that JAWS  
implemented years ago, collaborating with the US Treasury or seomthing. I  
proposed it to the whatwg a couple of years ago but my recollection is  
that this was rejected as not useful or important or something. Certainly  
it seems mor sensible to go with existing implementation than to make up  
something incompatible, and it seems that using data-* means we will  
actually get several dozen different versions of this - using ARIA would  
be an approximately infinitely better alternative.

> I wonder if the data-* attribute naming scheme could be classified
> somehow to allow basic type checking like this. I expect there will be
> other cases where authors want an attribute value to match the ID of an
> element in the page.

Sounds like a semantic web project to me, infobot.

(Personally I think that would be useful, but at that point I'd switch to  
basing my work on XML anyway, where there are infrastructures for this  
kind of thing).

cheers

Chaals

-- 
Charles McCathieNevile  Opera Software, Standards Group
     je parle français -- hablo español -- jeg lærer norsk
http://my.opera.com/chaals   Try Opera 9.5: http://snapshot.opera.com



More information about the whatwg mailing list