Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Section 508- 1194.22- Invalid errors detected ?

Options
LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited September 2004 in Ask a question
Please see message below
Hi,
In a JSP, When I define a Label outside an if construct, then I use that label within a TD tag inside the if construct, like the following format :
CODE
<LABEL NAME> = "VALUE" <LABEL NAME> TAG = "VALUE" "
.
.
if-else construct {
<TD ... ?class = .... ><%= LABEL NAME %>...</ TD>
"<input ?...........>"
then I close the td tag...

..
}
End of if -else construct
I still get the following error:
Section 508 - 1194.22: Form controls and their labels should be explicitly associated with the LABEL element.
Although the label will be printed out before all the input elements in the if-else statement. How can we fix this ? Do/Can we define new rules ? modify existing rules ? and how do we go about doing this ?

Thanks for your help

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    edited September 2004
    Options
    Hi AHesson,


    From the looks of it, the best solution to your problem is to suppress those errors.

    I see how your code is producing valid html. However, the html is generated using JSP and WebKing does not process JSP. Instead, WebKing tries to ignore the JSP content of a page, considering it "script" information. So, WebKing does not have a good way of knowing that the JSP on the page happens to create valid html.

    You could try to edit the Form1 or Form2 rules to ignore special cases, or maybe search for labels in the script content of the page, but either of these options require a strict interpretation of the page content.

    For example, you could add to Form1 rule so that it looked in "script" information for the string "<Label" and then continued searching until it hit the word "for=" and if it did, store the following value along with the other "for" values WebKing found on the page. But that's assuming a lot about how the code in the script parts of the page look, and could easily break.