[whatwg] Context help in Web Forms

Kristof Zelechovski giecrilj at stegny.2a.pl
Tue May 27 01:24:24 PDT 2008


A LABEL in the first column of a table has no way of containing the
corresponding INPUT in the second column; I suppose this was the use case
for LABEL[FOR].  I do not like it either but creating an alternative
alignment with CSS may be too cumbersome for many designers (to me, it is
just wishful thinking that you can make a good layout on a client machine by
measuring elements in advance) and such use of the TABLE does contain a
grain of meaning.
I understand that data attributes can be of much help; I just wonder why
nobody came up with an alternative solution of using a hidden sibling
instead ([DISPLAY=NONE] or [TYPE=HIDDEN] or whatever).  This has the
advantage of being valid HTML4.
Chris

-----Original Message-----
From: whatwg-bounces at lists.whatwg.org
[mailto:whatwg-bounces at lists.whatwg.org] On Behalf Of Ian Hickson
Sent: Tuesday, May 27, 2008 8:47 AM
To: Matthew Paul Thomas
Cc: WHATWG List
Subject: Re: [whatwg] Context help in Web Forms

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:
> > > 
> > > Or perhaps <a ... rel="help" for="phone-number">, to be consistent 
> > > with the for= attribute in <label>.
> > 
> > This is a possibility, but is it really needed? In general it seems 
> > we'd want to encourage authors to put the links near the text and 
> > controls to which it applies.
> 
> Sure, but I don't see how it's different from <label> in that respect: 
> we want to encourage authors to put <label> near the control to which it 
> applies, but <label> already has for=. (<label> can have weak semantic 
> value even when not related to a particular control, but then so could 
> rel="help".)

I'm not sure I would have designed <label> as it is either.


> > > 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.
> 
> Another possible presentation would be reserving whitespace to the right 
> of the form, and making <whatever rel="help" for="x"> visible in that 
> space whenever <input name="x"> was focused.
> 
> <http://uxmatters.com/MT/archives/000191.php> shows these and other 
> examples of dynamic help.

The data-* attributes are intended for scripts like this.


-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'




More information about the whatwg mailing list