I am currently using
Struts 1.2 in my application. Government regulations require that I comply with 508 accessibility rules, one of which is:
For each FORM control, place its label in a LABEL element. A LABEL is attached to a specific form control through the use of the "for" attribute. The value of the "for" attribute must be the same as the value of the "id" attribute of the form control.
For example:
<FORM action="http://somesite.com/foo" method="get">
<LABEL for="name">Name:</LABEL><br/><INPUT type="text" id="name" SIZE="50">
I currently have code that looks like this:
<LABEL for="userName">User ID :</LABEL>
<html:text id="userName" property="userName" size="15"/>
Initially, this caused the following server error:
Attribute id invalid for tag text according to TLD
I then modified the struts-html.tld file and added this code to the <name>text</name> section:
<attribute><br/> <name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
this resolved the server error but when the page renders the resulting HTML does not have the ID tag:
<LABEL for="userName">User ID :</LABEL>
<input type="text" name="userName" size="15" value="" />
Can anyone help here? I need to find a way to get the final HTML to have an ID tag in it.
Thanks for the help.
- Ben Hagadorn