struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glenn Wilson" <>
Subject validwhen not working
Date Sun, 15 Apr 2007 14:34:40 GMT
Hi all, new to using validator. I have validator working on most of my 
applicaiton but having a problem doing a "validwhen". I've been using the 
examples in the "Jakarta Struts Cookbook".

Here is my question(s):

I've noticed that javascript code is generated unique to the form name. 
However, when I setup a "validwhen" for  the form no form specific 
javascript code gets generated. If I include "date" in the "depends" 
attribute I do get javascript code to do the date validation but nothing to 
deal with the validwhen?

So in my example, I have a page called Spiffs. The form name is SpiffsForm 
and I've included the <html:javascript formName="SpiffsForm" cdata="false"/> 
tag in the page. I have two date/text fields (startDate,endDate) which are 
optional however, when one is populated the other date field needs to be 

The validation.xml file reads

<form name="SpiffsForm">
<field property="spiffFilter.startDateAsString" depends="validwhen">
<arg key="spiffs.prompt.startDate" position="0"/>
      <var-value>((spiffFilter.endDateAsString == null) or (*this* != 
<field property="spiffFilter.endDateAsString" depends="validwhen">
<arg key="spiffs.prompt.endDate" position="0"/>
      <var-value>((spiffFilter.startDateAsString == null) or (*this* != 

I'm using Struts 1.3.5 with validator 1.3.0 on a Tomcat 5.5 instance.

Any help would be appreciated.

Mortgage rates near historic lows. Refinance $200,000 loan for as low as 

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

View raw message