On Aug 15, 7:56 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> I found your post confusing; I think you have used the word "form" in
> several places where you really mean "field".

Sorry, I can see the confusion.  You are correct, I am referring to a
field.  In this particular case, the entire form was made up of one
field, and I made the mistake when writing the post, mixing up the
two.

> Yes, the rendering of a form
> field with choices as a radio input, by default, sets the overall label for
> the field to be "for" the first choice in the list.

This is what I would like to be able to set dynamically.  I know I can
pass the auto_id or the prefix, but those seem to affect the label and
all the  options.

>
> >  This breaks
> > accessibility for us (viewable at wave.webaim.org), and html
> > validation (at validator.w3.org).
>
> Breaks accessibility how? Clicking on the overall field label is the same as
> clicking on the label for the first choice...is that breaking accessibility?
> I can see how that behavior might be non-obvious but I don't see that it is
> "broken".
>
> What HTML validation errors are you getting, and what HTML doctype are you
> using? In a brief test of HTML from a page that uses a Django radio select
> field rendered in this way I am not getting any validation errors from
> validator.w3.org.
>

The doctype is XHTML Transitional, and the validation error I am
getting on each of the options for the field is: "document type does
not allow element "ul" here; missing one of "object", "applet", "map",
"iframe", "button", "ins", "del" start-tag"

That error might have something to do with what I am doing, although
it appears to be entirely contained in the outputted code from
form.as_ul.  The more pressing and pertinent question (for me) is the
accessibility error from wave.webaim.org:

"ERROR: Multiple form labels.  A form element has two labels
associated with it."

> You haven't said what you would like to see instead. If you want no label at
> all for the overall field you can pass an empty string as label on the form
> field definition. If you do want the text of the label, but you don't want
> it to be wrapped in the html label tag, then maybe you want a custom
> RadioFieldRenderer. This is possible but not currently documented, ticket
> #15244 has a patch with some how-to doc that you may find useful.

What I would like the ability to set the field label to a value of my
choosing, as that is what allows the validator at webaim to "pass" my
html.  If this is not something that seems to affect anyone else, it
might be the best for me to write a custom renderer.  I appreciate the
response and the pointer to the ticket with some info, as I was poking
around this morning trying to see what piece of code (field, widget,
etc.?) to do on my own in order to enable this functionality.  I still
would appreciate it if you could try the validator at webaim and see
if you can replicate the error I see there (multiple lables for an
input; the default as you describe it), as I am most interested in
learning if this is a real problem, and I trust the community to
educate me ;)

Thanks,

Wayne

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to