Actualy, I just found out that this is not "illegal" and it will not crash
anything ( it will just look odd in the validation.xml file ):

<form name="incMortPayForm">

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

</form>

can be split into:

<form name="incMortPayForm">

<field property="newAmount" depends="xor">
                 ........................
</field>
<field property="newAmount" depends="amountNoRequired">
                 ........................
</field>
<field property="newAmount" depends="integer">
                 ........................
</field>
<field property="newAmount" depends="required">
                 ........................
</field>
<field property="newAmount" depends="blahblah">
                 ........................
</field>

</form>

Thereby GURANTEEING the sequence of validation - we have very complex
validations, and they must be done in
a particular sequence...

Regards, a.m.




                                                                          
  "Yansheng Lin"                                                          
  <[EMAIL PROTECTED]>             To:        "'Struts Users Mailing 
                                List'" <[EMAIL PROTECTED]>   
                                        cc:                               
  25/07/2003 04:24 PM                   Subject:        RE: validation    
  Please respond to "Struts     sequence                                  
  Users Mailing List"                                                     
                                                                          






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


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
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" <[EMAIL PROTECTED]>
25/07/2003 03:34 PM Please respond to "Struts Users Mailing List"
To:     "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
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:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: July
25, 2003 1:12 PM To: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For
additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To
unsubscribe, e-mail: [EMAIL PROTECTED] For
additional commands, e-mail: [EMAIL PROTECTED]



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

Reply via email to