struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thiago Tonelli Bartolomei <>
Subject Validating an integer and a double problem
Date Fri, 25 Jul 2003 15:05:47 GMT
    I'm trying to use the validator on two fields of my form. One field 
is an integer and the other is a double. They are both required. The 
problem is that only the integer and required validations are working. 
The double validation is not called from the generated 
dynamicJavascript. The question is: Why the generated javascript does 
not call something like :

    return validateRequired(form) && validateInteger(form) && validateDouble(form);

I thank you all in advance :)

	Thiago Bartolomei


validation.xml :
       <form name="myForm">
          <field property="doubleField" depends="required,double">
              <arg0 key="label.doubleField" />
          <field property="integerField" depends="required,integer">
              <arg0 key="label.integerField" />

on the jsp file :
<%-- initialize the validation javascripts --%>
<html:javascript formName="myForm" />


<html:form action="" onsubmit="validateMyForm(this)">

on the generated html file :

<script type="text/javascript" language="Javascript1.1"> 

<!-- Begin 

     var bCancel = false; 

    function validateMyForm(form) {                                                      
        if (bCancel) 
      return true; 
       return validateRequired(form) && validateInteger(form); 

    function required () { 
     this.aa = new Array("doubleField", "My Required Description", new Function ("varName",
" return this[varName];"));
     this.ab = new Array("integerField", "My Required Description", new Function ("varName",
" return this[varName];"));

    function IntegerValidations () { 
     this.aa = new Array("integerField", "My Integer Description", new Function ("varName",
" return this[varName];"));

Thiago Tonelli Bartolomei
Icaro Technologies -
Phone: +55-19-3237-7878 x.249

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message