cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@media.demon.co.uk>
Subject Woody and WAI
Date Thu, 15 Jan 2004 20:17:13 GMT
Hi All,

I am in the process of getting some Woody forms approved as WAI 
compliant.

	http://www.w3.org/WAI/

While WAI may not be everybody's cup of tea ..... in certain sectors it 
is a common requirement .... and it is certainly not a bad selling 
point.


There are three issues which come up regularly with basic Woody forms:

1) Provide an explicit label for each form control. (Level 2)
2) Include default, place-holding characters in edit boxes and text 
areas. (Level 3)
3) Provide a summary for tables. (Level 3)

I am thinking that these are issues which Woody could handle 
automatically for us.
While there are obviously workarounds for all of these, I think it 
would be advantageous to make this work as automatically as possible, 
where it does not interfere with anything.

Issue (1) requires that a form field have a label linked to it:

	<label for="name-field">Your Name</label>
	<input id="name-field" name="name" title="your name here" type="text" 
etc. />

While this issue can be solved by wrapping the <label> tags around your 
<wt:widget-label>s in your template, if WoodyTransformer were changed 
to preserve the <wt:widget-label> tag instead of consuming it, then the 
Woody StyleSheets were modified to recognise that tag, Woody could 
handle this WAI issue out of the box.

Issue (2), placeholder text, is slightly more complicated. I think we 
would have to introduce the concept of a default value to Woody's field 
markup, with the *option* to automatically invalidate fields which had 
their default values in.

Furthermore, I suspect it would be best if such fields had JavaScript 
like the following in them, when they have been populated with a 
default value that is not allowed by the validation:

<input name="sample-field"
	value="default value"
	onfocus="if (this.value == 'default value') this.value = '';"
	onblur="if (this.value == '') this.value = 'default value';"
	etc.
/>

Issue (3) making sure tables have summaries is easy:

	<table summary="this is a summary of the table's contents">

Several widgets in Woody make Tables, I propose that their 'hint' could 
be used as the summary.


WDYT folks?

Objections, suggestions etc. welcome

regards Jeremy

Mime
View raw message