You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Álvaro Gutiérrez Romero (JIRA)" <ji...@apache.org> on 2011/03/22 17:01:05 UTC
[jira] [Commented] (WW-3283) client side validation for css_xhtml
fails when using required="true"
[ https://issues.apache.org/jira/browse/WW-3283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009686#comment-13009686 ]
Álvaro Gutiérrez Romero commented on WW-3283:
---------------------------------------------
I think this is a clone of WW-3393.
> client side validation for css_xhtml fails when using required="true"
> ---------------------------------------------------------------------
>
> Key: WW-3283
> URL: https://issues.apache.org/jira/browse/WW-3283
> Project: Struts 2
> Issue Type: Bug
> Components: XML Validators
> Reporter: David S.
>
> Within the validation.js file for the css_xhtml theme the function findWWCtrlNode(enclosingDiv ) uses the code....
> for(var elem in enclosingDiv.getElementsByTagName("div")) {
> to find either div's or later span's. This code only returns undefined responses and therefore always returns the final line of code within the function...
> return enclosingDiv.getElementsByTagName("span")[0];
> This returns null if the user hasn't set required="true" within the taglib but will return the span used for showing * in red as a required field otherwise. This means that the new inserting error div generates a javascript error....
> Possible solutions...
> 1. Change the loop to actually find the classes it is searching for
> var e=enclosingDiv.getElementsByTagName("div");
> for(var i=0;i<e.length;i++) {
> if (e[i].className && e[i].className.match(/(wwlbl|wwctrl)/))
> return e[i];
> }
> 2. add a span into the generated css code so that when the final line of code searches for the first one it find one that it can inssert the error code into
> 3. return nll if no div's or spans are found
> Cheers
> Dave
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira