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/06/06 09:21:59 UTC

DO NOT REPLY [Bug 20541] New: - validator rule on requiredif error

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=20541>.
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=20541

validator rule on requiredif error

           Summary: validator rule on requiredif error
           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: steveleung.geo@yahoo.com


In this version, the requiredif rule field name field-* is invalid in
javascript. For example, I declare var-name in xml file, 
              <var>
                  <var-name>field-test[0]</var-name>
                  <var-value>NOTNULL</var-value>
              </var>
It will generate 
 new Function( "varName", 
  "this.mask=/^[0-9][0-9][0-9][0-9]$/; this.field[0]='studentNum';
this.field-test[0]='NOTNULL';  return this[varName];");

The name field-* is not valid in javascript. However in 
org.apache.struts.validator.FieldChecks, the method validateRequiredIf seems
make use the name 
String dependTest = field.getVarValue("field-test[" + i + "]");

Please fix it in future release

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org