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/05 12:17:01 UTC

DO NOT REPLY [Bug 17667] New: - Client-side validation with multi-form page

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