Both Patrick and Ted made good suggestions.  However, I'd
prefer to see the page in question before making Patrick's
suggestion.  If the form is like some of mine, that simply
won't work.

The title option always works, but the user must know the
title is there before it can help them.

Your best option is to use the Value attribute of the
textbox or input field.  This allows you to enter
information that will help the user fill out the form
correctly.  Using ECMAscript you can empty the text once
the user begins to type.  That would require using
OnKeyDown.  OnFocus may not give the person time enough to
read the Value information if they tab to the field below
the viewable portion of the form (ie, below the fold).

I hope this helps.

Lee Roberts
http://www.roserockdesign.com
http://www.applepiecart.com 

-----Original Message-----
From: Patrick Lauke [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 22, 2004 10:15 AM
To: [EMAIL PROTECTED]
Subject: RE: [WSG] semantic way to mark up form help?

Maybe a slight stretch, but how about wrapping these
related elements (label, input, etc) up in their own
fieldset, and using the legend for that text (thus
associating it with the (input and label within).

<form...>
<fieldset>
<legend>This is the title of your news post (does not
accept HTML input)</legend> <label...>...</label>
<input..../> </fieldset> </form>

Other suggestion: use a title on the input

<input... title="This is the title of your news post (does
not accept HTML input)" />

To be honest, I wouldn't get too overly worried about
getting the semantics exactly right in this case, mainly
because HTML is a flawed language with very few general
(and a few overly specific) elements with defined semantic
meaning and relationship. Anything that falls outside of
that is always going to be a rough approximation - trying
to squeeze the requirement of semantics encountered in the
real-world into the small, restricitve slots provided by
the existing spec. (then again, you could create your own
DTD that adds your own nice custom explanation element to
the current set ;) )

Patrick
________________________________
Patrick H. Lauke
Webmaster / University of Salford
http://www.salford.ac.uk

> -----Original Message-----
> From: Justin French
> Sent: 22 July 2004 15:25
> To: [EMAIL PROTECTED]
> Subject: [WSG] semantic way to mark up form help?
> 
> 
> Hi all,
> 
> I'm trying to decide on a nice semantic way to mark-up a
short 
> (usually only a few words) block of help text in the
context of a web 
> form.  I currently use a label to label the input, and a
paragraph or 
> div to mark-up the help text:
> 
> <form...>
>       <div class='formitem'>
>               <label for='f-title'>...</label>
>               <input id='f-title' type='text'... />
>               <p class='help'>This is the title of your
news post, which does not 
> accept HTML input</p>
>       </div>
> </form>
> 
> But logic tells me that in the above example, the <p>
help text is not 
> associated with the form widget or the label at all.
The only way I 
> can see this being done is by including the help text in
the label, 
> but this will restrict me in terms of layouts.
> 
> Honestly, the most logical way I can see to do this is
to have them in 
> three cells of a table row, since at least they'll be
associated in a 
> row.  <fieldset>'s would also be nice, but they're
intended for 
> groupings of form elements, and using them for each text
input seems 
> like a load of bloat.
> 
> I've been looking at many examples of "correct, semantic
forms", but 
> can't see anything like this out there.
> 
> TIA
> 
> ---
> Justin French
> http://indent.com.au
> 
> *****************************************************
> The discussion list for http://webstandardsgroup.org/
See 
> http://webstandardsgroup.org/mail/guidelines.cfm
> for some hints on posting to the list & getting help
> *****************************************************
> 
> 
*****************************************************
The discussion list for http://webstandardsgroup.org/ See
http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
***************************************************** 



*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
***************************************************** 

Reply via email to