struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yansheng Lin" <yansheng....@isogis.com>
Subject RE: validation sequence
Date Fri, 25 Jul 2003 20:24:12 GMT

Ok, if you want to be 100% sure the sequence is right, add an alert() statement
in each validate functions:).
	 

-----Original Message-----
From: Aleksander.Matijara@bmo.com [mailto:Aleksander.Matijara@bmo.com] 
Sent: July 25, 2003 2:08 PM
To: Struts Users Mailing List
Subject: RE: validation sequence


This is my form and the generated Javascript, please note the position of 
the * integer * validator.  Most of the validators are custom, except the
* integer * validator, and for some reason, it puts it at the END of the 
generated validator Javascript.

Thanks, a.m.


<form name="incMortPayForm">
                        <field property="mortNumber"
depends="reqXDefault,integer">

                   ........................


                        </field> 
                        <field property="newAmount"
depends="xor,amountNoRequired">
                  ........................

                        </field>
                        <field property="pcntIncrease" depends="xor,pcntAmount">
                  ........................

                        </field>
                        <field property="coCardNumber"
depends="condRequired,condMask">
                  ........................

                        </field>
                        <field property="coPassword" depends="condRequired">
                  ........................

                        </field>
                        <field property="guarCardNumber"
depends="condRequired,condMask">
                  ........................

                        </field>
                        <field property="guarPassword" depends="condRequired">
                  ........................

                        </field> 
                </form>



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

<!-- Begin 

     var bCancel = false; 

    function validateIncMortPayForm(form) {   
        if (bCancel) 
      return true; 
        else 
       return validateReqXDefault(form) && validateXOR(form) && 
validateAmount(form) && validatePcntAmount(form) && 
validateCondRequired(form) && validateCondMask(form) && 
validateInteger(form); 
   } 









"Yansheng Lin" <yansheng.lin@isogis.com>
25/07/2003 03:34 PM
Please respond to "Struts Users Mailing List"

 
        To:     "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
        cc: 
        Subject:        RE: validation sequence


On client side, if your javascript is something like:

   return validateA(form) && validateMask(form) && validateB(form)

than the execution sequence will be from left to right.





-----Original Message-----
From: Aleksander.Matijara@bmo.com [mailto:Aleksander.Matijara@bmo.com] 
Sent: July 25, 2003 1:12 PM
To: struts-user@jakarta.apache.org
Subject: validation sequence


Hi there,

I was wondering, does anyone know in which sequence this kind of 
validation will happen -

depends="acustomvalidation,mask,bcustomvalidation"

so, will it be alphabetic as in:

acustomvalidation,bcustomvalidation,mask

or

acustomvalidation,mask,bcustomvalidation

or random??

Thanks, Aleksandar.


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





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


Mime
View raw message