You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/03/14 22:55:29 UTC
DO NOT REPLY [Bug 18018] New: -
requiredif variable names crash javascript validation
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18018
requiredif variable names crash javascript validation
Summary: requiredif variable names crash javascript validation
Product: Struts
Version: 1.1 RC1
Platform: All
OS/Version: All
Status: NEW
Severity: Critical
Priority: Other
Component: Validator Framework
AssignedTo: struts-dev@jakarta.apache.org
ReportedBy: eschnell@nvisia.com
CC: galwar@nvisia.com
Although requiredif is never checked on the client it is not possible to enable
client validation on other fields if the form uses requiredif for server-side
validation.
Mozilla's javascript engine (and presumably IE's because both give the same end
behavior) will not allow a variable to be named "field-test" or "field-join".
Specifically the bug is in:
this.ae = new Array("lastName", "Last Name can not be less than 2
characters.", new Function ("varName", "this.field[0]='firstName';
this.field-test[0]='NOTNULL'; this.minlength=2; return this[varName];"));
this is easily proven by typing var field-test = new Array(); into a javascript
engine.
The only workaround I can see is to rename the variables, allow alternate names
or hack JavascriptValidatorTag.java to support a new jsType called "omit" which
will omit any variables not used by javascript.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org