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 2004/05/15 08:55:49 UTC

DO NOT REPLY [Bug 29004] New: - ActionValidatorForms cause badly formed validator javascript

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29004>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29004

ActionValidatorForms cause badly formed validator javascript

           Summary: ActionValidatorForms cause badly formed validator
                    javascript
           Product: Struts
           Version: Nightly Build
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Validator Framework
        AssignedTo: dev@struts.apache.org
        ReportedBy: jhertz@speakeasy.net


This javascript came out of the validator using a 5/13 Nightly. 

Note the function names are based upon the ActionMapping name (complete with a 
leading slash!). I'm using a ValidatorActionForm (actually, 
DynaActionValidatorForm), so the validation is performed based upon the 
ActionMapping itself rather than the Form used, which probably explains where 
things are going wrong :-)

Also note the "null is required" and "null is an invalid e-mail address". 
Backing out to the 3/28 build, the strings are formed correctly. (I wouldn't 
normally enter more than one problem in a bug report, but it's all about the 
same piece of flawed javascript :-/)

Example follows:

    function /RecoverUsername_required () { 
     this.a0 = new Array("emailAddress", "null is required.", new Function 
("varName", " return this[varName];"));
    } 

    function /RecoverUsername_email () { 
     this.a0 = new Array("emailAddress", "null is an invalid e-mail address.", 
new Function ("varName", " return this[varName];"));
    } 

validator.xml snippet:

		<form name="/RecoverUsername">
			<field property="emailAddress"
			       depends="required, email">
				<arg0 key="emailAddress.label"/>
			</field>
		</form>

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