#14921XHTML and accessibility of FORM cObj
Description
The cObj FORM currently doesn’t render accessible mailforms, even if setting “accessible=1” in its conf. In a discussion in TYPO3-content-rendering mailing list (6.6.2005), ben van’t ende proposed a patch, which can be found here:
http://typo3.org/teams/content-rendering/get-the-x-into-html/
This hasn’t been incorporated into CVS yet. I found some bugs in this implementation and added some enhancements, so we could apply it to CVS and have it included in 3.8.1.
What ben’s patch solve:
- Added: FORM conf variable: fieldPrefix where we can set a prefix to use for all fields in this form (instead of the default “formName”, which is probably an unique-hash).
- Added: FORM conf variable: dontMd5FieldNames where we can decide not to md5 the field names in the id fields.
- Fixed: generates one ID for each option on radio-fields, instead of reusing the same ID (generating invalid XHTML).
- Fixed: In strict XHTML mode, set the FORM ID instead of the NAME attribute.
My additions to ben’s patch were:
- Added: In “accessibility” mode, we need to create a <fieldset> for the radio-buttons, so we have an ID to which the LABEL refers to. Else we end up with invalid XHTML (reference to unknown id). This is also the most “accessible” way (the field-label refers to the whole group of radio-buttons).<br>- Added: In radio-buttons, the descriptive text after the radio-button is the LABEL for this specific button. So this will now wrap a <label> tag around the text with the correct ID (so one can click on the text next to the radio-buttons to activate them). Only in accessibilty=1.<br>- Fixed: Check for ctype_digit in formname before generating the prefix, else we might end up having a digit as the first character of the prefix.<br>- Fixed: ben’s patch wouldn’t work with accessible=0 (generates invalid XHTML).<br>- Fixed: On form elements of type “label”, there is no element with an ID, so we should not create a LABEL-tag pointing to an ID that does not exist (generates invalid XHTML). <p>Attached is a patch that includes ben’s and my additions. Read to be included in CVS for 3.8.1 (no change in features, just adds options).</p> <p>This patch also applies to 3.8.0, for the interested reader! :)</p> <p>(issue imported from #M1369)</p></label></fieldset>Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.