struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lee Cheng Wei (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-2409) CLONE -Client side validation in xhtml template and clearErrorMessages not working in firefox with hidden fields
Date Wed, 23 Jan 2008 15:17:06 GMT

    [ https://issues.apache.org/struts/browse/WW-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43074#action_43074
] 

Lee Cheng Wei commented on WW-2409:
-----------------------------------

So what should I do to rectify this?

 pe: Bug> > Components: Plugin - Tags> > Affects Versions: 2.0.11> > Environment:
Firefox and IE> > Reporter: Lee Cheng Wei> > Assignee: James Holmes> > Priority:
Minor> >> > The method clearErrorMessages in the xhtml client side validation
template (template/xhtml/validation.js) fails in firefox. This results in the error messages
being duplicated each time the form is submitted.> > The problem arises from the first
three lines of code in the function:> > var table = form.childNodes[1];> > if(
typeof table == "undefined" ) {> > table = form.childNodes[0];> > }> > This
presumes that the first (or second) node of the form element is the field table. However in
firefox hidden fields within a form are moved in the DOM to the top of its children. Thus
wherever you put the hidden elements in the form they appear in the DOM at the top. The same
problem does not occur in internet explorer or if no hidden fields are present. I have not
tried other browsers.> > I have replaced these t
 hree lines with the patch:> > // get field table> > var table;> > for (var
i = 0; i < form.childNodes.length; i++){> > if (form.childNodes[i].tagName != null
&& form.childNodes[i].tagName.toLowerCase() == "table"){> > table = form.childNodes[i];>
> break;> > }> > }> > if (table == null){> > return;> > }>
> This solves the problem.> > -- > This message is automatically generated by
JIRA.> -> You can reply to this email to add a comment to the issue online.> 
_________________________________________________________________
Easily manage multiple email accounts with Windows Live Mail!
http://www.get.live.com/wl/all


> CLONE -Client side validation in xhtml template and clearErrorMessages not working in
firefox with hidden fields
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-2409
>                 URL: https://issues.apache.org/struts/browse/WW-2409
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.0.11
>         Environment: Firefox and IE
>            Reporter: Lee Cheng Wei
>            Assignee: James Holmes
>            Priority: Minor
>
> The method clearErrorMessages in the xhtml client side validation template (template/xhtml/validation.js)
fails in firefox. This results in the error messages being duplicated each time the form is
submitted.
> The problem arises from the first three lines of code in the function:
>     var table = form.childNodes[1];
>     if( typeof table == "undefined" ) {
>         table = form.childNodes[0];
>     }
> This presumes that the first (or second) node of the form element is the field table.
However in firefox hidden fields within a form are moved in the DOM to the top of its children.
Thus wherever you put the hidden elements in the form they appear in the DOM at the top. The
same problem does not occur in internet explorer or if no hidden fields are present. I have
not tried other browsers.
> I have replaced these three lines with the patch:
> // get field table
> var table;
> for (var i = 0; i < form.childNodes.length; i++){
>     if (form.childNodes[i].tagName != null && form.childNodes[i].tagName.toLowerCase()
== "table"){
>         table = form.childNodes[i];
>         break;
>     }
> }
> if (table == null){
>     return;
> }
> This solves the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message