You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brendan Richards <br...@designuk.com> on 2004/03/18 17:50:06 UTC

validwhen validation question

I'm looking at using validwhen for a complex validation. 
 
I've got a value that can either be ignored when another parameter is
set or is valid when it's a date.
 
A simple date validation would be something like this:
<field property="date" depends="required,date">
        <arg0 key="myForm.date"/>
 
<var><var-name>datePattern</var-name><var-value>dd-MM-yyyy</var-value></
var>
    </field>
 
Can a validwhen call another validation? Giving you something like
 
 
<field property="date" depends="validwhen">
      <arg0 key="myform.date"/>
        <var>
          <var-name>test</var-name>
          <var-value>((ignoreDate == "yes") or ( #insert date
validation#  ))</var-value>
        </var>
      </field>
 
or should I just write my own validation rule / do it with javascript
before I submit?
 
 
 
Thanks,
 
Brendan

Re: validwhen validation question

Posted by Mah R <ja...@yahoo.com>.
Is it possisble to use validwhen for date fields like comparing dates?
 


Brendan Richards <br...@designuk.com> wrote:
I'm looking at using validwhen for a complex validation. 

I've got a value that can either be ignored when another parameter is
set or is valid when it's a date.

A simple date validation would be something like this:



datePatterndd-MM-yyyyvar>


Can a validwhen call another validation? Giving you something like





test
((ignoreDate == "yes") or ( #insert date
validation# ))



or should I just write my own validation rule / do it with javascript
before I submit?



Thanks,

Brendan

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.