[ http://issues.apache.org/struts/browse/STR-1272?page=all ]
     
Don Brown reopened STR-1272:
----------------------------

    Assign To:     (was: Struts Developer Mailing List)

> Client-side validation with multi-form page
> -------------------------------------------
>
>          Key: STR-1272
>          URL: http://issues.apache.org/struts/browse/STR-1272
>      Project: Struts Action 1
>         Type: Improvement

>   Components: Action
>     Versions: Unknown
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Alexander Merk
>     Priority: Minor
>      Fix For: 1.2 Family
>  Attachments: JavaScriptValidatorTag-multiform.patch, strutsPatch.txt, 
> validator-rules-multiform.patch, validatorPatch.txt
>
> if you have two forms on your page with validation (e.g. DateValidation) the 
> two <html:javascript> tags generates two function with the same name (e.g. 
> DateValidations() ).
> My suggestion is to generate functions with prefix (or postfix) of the form:
> function FormName_DateValidations(){
>     this.aa = ....
>     this.ab = ....
> }
> That means also you have to modify the javascript method (defined in the 
> validator-rules.xml). 
> In my example:
> //// begin original code
> function validateDate(form) {
>                var bValid = true;
>                var focusField = null;
>                var i = 0;
>                var fields = new Array();
>                oDate = new DateValidations();
> //// end original code
> //// begin modified code
> function validateDate(form) {
>                var bValid = true;
>                var focusField = null;
>                var i = 0;
>                var fields = new Array();
>                oDate = eval('new ' + form.name +'_DateValidations();');
> //// end modified code
> i hope you understand what i mean ;-)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to