struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17667] New: - Client-side validation with multi-form page
Date Wed, 05 Mar 2003 11:17:01 GMT
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=17667>.
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=17667

Client-side validation with multi-form page

           Summary: Client-side validation with multi-form page
           Product: Struts
           Version: 1.1 RC1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Validator Framework
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: a.merk@gmx.de


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 ;-)

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


Mime
View raw message