Needs work
Project:
Date
Version:
7.x-2.x-dev
Component:
Date Popup
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Oct 2009 at 15:35 UTC
Updated:
15 Apr 2015 at 15:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
a1russell commentedI also ran into this problem and created this patch. Any suggestions for improvement are welcome...
Comment #2
anrikun commentedComment #3
anrikun commentedAfter applying the patch, "Label for" works but I still get these validation errors:
HTML is:
Comment #4
anrikun commentedComment #5
anrikun commentedA way to fix this is to override
theme_form_element()in your theme's template.php by adding:Comment #6
devin carlson commentedI am also getting these validation errors when creating an exposed date filter with the calendar pop up.
I'm using version 6.x-2.7 of date.
Although it is possible to use the method described by anrikun, it would be nice to have this fixed in the module itself.
Comment #7
cpliakas commentedThis is also an issue for 508 compliance. The attached patch avoids having to override theme_form_element() in template.php, which is a slick solution but a pain to do on every site. In addition, this fixes issues with duplicate "id" attributes in the wrapper element when multiple filters are used on the same page.
The attached images are screenshots of the markup before and after the patch is applied.
Thanks,
Chris
Comment #8
cpliakas commentedJust to follow up and clarify why there is a need for a theme_date_popup_wrapper_element() function in the patch...
If we use the standard theme_form_element() function, then both the inner and outer div elements will have the same "id" attribute, which is not good. The theme_date_popup_wrapper_element() makes the id for the outer div end with "-outer-wrapper" as opposed to just "-wrapper" avoiding the conflict. It sucks that we have to copy the entire function the change that small bit, but there are no override avenues we can take to modify the default output of theme_form_element().
Thanks,
Chris
Comment #9
cpliakas commentedRerolled patch posted in #7 to fix a typo in the commit message and fix a call to $t(), which should be t().
Thanks,
Chris
Comment #10
xavi.rodriguez commentedHi everyone!
I want thank cpliakas and anrikun for their patch, but it still having problems because when the output is:
it doesn't pass accessibility test. Now, I changed it for a < s p a n >
What do you think about it?
PS: In spain, by-law ALL the governmental websites must have a Double-A Level conformance to Web Content Accessibility Guidelines 1.0
Comment #11
anrikun commentedA what ? ;-) You forgot to escape your tag.
Comment #12
xavi.rodriguez commentedIm sorry, i changed it for a span tag, instead of label.
Comment #13
xavi.rodriguez commentedComment #14
mradcliffeThis also affects the 7.x-2.x branch. It may also crash IE8 and printing (can't find a good test case to reproduce).
Comment #15
Everett Zufelt commentedThis is definitely a problem for accessibility. Ensuring that the form field has a programmatically determinable name (label for="field-id" is essential.
Is there anything that we could do in D8 Core forms API to make this type of work easier in the future?
@javi.rodriguez - replacing the label with a span may resolve the validation error, but the purpose of the validation error is to signal that something is wrong, your work around fixes the error, but not the problem that the form is poorly accessible.
Comment #16
mradcliffeI am not sure, but there may not be anything to do in core.
Date popup keeps the same element id while adding additional render elements underneath it with different HTML ids as part of its element #process callback (Reference line 316 and 119 of date_popup.module). I think the only way to fix this without a theme override is to change Date popup to change the main element id to the id it will use for its main HTML form element.
Comment #17
a1russell commentedComment #18
mgiffordI'm assuming this is still an issue with D7 so just moving it ahead.
Comment #19
David_Rothstein commentedI think there might be two separate issues here?
Given the above, I'm not sure if this issue should be closed as a duplicate of the others? (I haven't looked too closely at the patches posted here.)
Comment #20
zxaos commentedAs a quick update, this is in fact still an issue on 7.x, and is not limited to the popup element. I'd also argue that it's still a separate issue from the two @david_rothstein listed.