Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Attribute id invalid for tag text according to TLD

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go back to using the original TLD for the <html:text> tag, and specify styleId="name". When the HTML input tag is rendered, "styleId" will be rendered as "id".
 
Ben Hagadorn
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Merrill,

Thanks so much for your help - that did the trick!
 
Ben Hagadorn
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Merrill,

Thanks so much for your help - that did the trick!
 
Everybody! Do the Funky Monkey! Like this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic