You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Maurizio Cucchiara (JIRA)" <ji...@apache.org> on 2011/03/23 17:01:05 UTC

[jira] [Closed] (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:all-tabpanel ]

Maurizio Cucchiara closed WW-3283.
----------------------------------

       Resolution: Duplicate
    Fix Version/s: 2.2.1
         Assignee: Maurizio Cucchiara

Álvaro, thanks for reporting the duplication 

> 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.
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.2.1
>
>
> 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