Re: RadioWidget patch (render items using the LABEL tag)

Clemens Klein-Robbenhaar <crobbenhaar-S0/[email protected]> Sun, 01 Jan 2006 11:36:06 +0100
Newsgroups gmane.comp.web.zope.formulator.devel
Message-ID <[email protected]>
Hi Bertrand:

[...]
> Here is a patch that let the RadioWidget items render as follow:
> 
> <label for="key_value1"><input type="radio"...>text</label>
> 
[...]

  Sorry for the extra long delay to apply the patch. I even have no good excuse
for it. Well, the patch now in the CVS HEAD finally.

  I have figured out that one can drop the "for"-attribute of the label;
it then automatically applies to the single form field inside of the label.
This not only makes the code a little simpler but also makes sure the label
applies to the correct radio button if the same form is rendered twice
for some reason. (With the "for"/"id" attributes it always applies to the box
in the form rendered first.)

  Dropping the "for" works at least with mozilla 1.7. Please tell me it it does
not work for some browser where the label with a "for" attribute is assumed to work;
I will revert to the original patch in that case.


Cheers anyway,
Clemens