struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <>
Subject Re: Error message's is not XHTML valid
Date Thu, 13 Mar 2014 06:49:49 GMT
All these errorFor's are used to identify tags which present error
messages and allow to delete them using JS. I'm not sure but maybe
XHTML allows custom attributes, if not we can use id with prefix, ie:
<tr id="error-for-....."

JS snippet
// clear out any rows with an "errorFor" attribute
    // clear out any rows with an "errorFor" attribute
    var rows = table.rows;
    if (rows === null){

    var rowsToDelete = [];
    for(i = 0; i < rows.length; i++) {
        r = rows[i];
        // allow blank errorFor values on dojo markup
        if (r.getAttribute("errorFor") !== null) {

    // now delete the rows
    for (i = 0; i < rowsToDelete.length; i++) {
        r = rowsToDelete[i];

+ 48 606 323 122

2014-03-10 19:49 GMT+01:00 Fredrik Andersson <>:
> Hello guys!
> I might need to bother you about this presumptive bug also.
> Since you know I'm trying to produce a app that renders in XHTML.
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
> <html xmlns="">
> (I use struts
> I got struts-user-input-validations in a form.
> For eg one field is a email-address-field and must be filled in by the user.
> So if I submit this form without any email-address there will be an error message.
> I would like that that page would consist of valid xhtml as. A snippet from this page
with the error message looks like:
> 25 <form id="productcommentssave" name="productcommentssave" action="/productcommentssave.action"
> method="post">
> 26 <table class="wwFormTable">
> 27 <tr errorFor="productcommentssave_productComment_emailAddress">
> 28 <td align="center" valign="top" colspan="2"><span class="errorMessage">Email
> address is required!</span></td>
> 29 </tr>
> 30 <tr>
> 31 <td align="left" valign="top" colspan="2"><label for="productcommentssave_productComment_emailAddress"
> class="errorLabel">Email address:</label></td>
> 32 </tr>
> 33 <tr>
> 34 <td
> 35><input type="text" name="productComment.emailAddress" size="40" maxlength="128"
> id="productcommentssave_productComment_emailAddress"/></td>
> 36 </tr>
> ...
> I get this xhtml-validation-message from w3c:
> Line 27, Column 23: there is no attribute "errorFor"
> <tr errorFor="productcommentssave_productComment_emailAddress">
> You have used the attribute named above in your document, but the document type you are
> does not support that attribute for this element. This error is often caused by incorrect
> use of the "Strict" document type with a document that uses frames (e.g. you must use
> "Transitional" document type to get the "target" attribute), or by using vendor proprietary
> extensions such as "marginheight" (this is usually fixed by using CSS to achieve the
> effect instead).
> This error may also result if the element itself is not supported in the document type
> are using, as an undefined element will have no supported attributes; in this case, see
> element-undefined error message for further information.
> How to fix: check the spelling and case of the element and attribute, (Remember XHTML
is all
> lower-case) and/or check that they are both allowed in the chosen document type, and/or
> CSS instead of this attribute. If you received this error when using the <embed>
> to incorporate flash media in a Web page, see the FAQ item on valid flash.
> What do you you think guys? The tr-tag does not look OK according to me, but I might
be wrong?
> What is this attribue "errorFor", how is it used by struts?
> Do you guys see any solution to this?
> Best regards
> Fredrik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message