This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes conditional  Date field  validation in struts validation.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "conditional  Date field  validation in struts validation.xml" Watch "conditional  Date field  validation in struts validation.xml" New topic
Author

conditional Date field validation in struts validation.xml

satish sat
Greenhorn

Joined: Aug 23, 2005
Posts: 2
Hi,

I need a help or suggestion from anyone of you regarding the conditional date field validation

i have a form which has three fields

1. determinationDate
2. parentCooperation
3. check


Date should follow datepatternStrict and should be validated only when the value of parentCooperation is Parent is NonCooperative and check is true.

i have tried as below
but i am not getting the result expected.
if anyone find something wrong
please let me know
i appreciate your help Thanks.

<form name="NonForm1">
<field property="determinationDate" depends="requiredif,date">
<arg0 key="NonCooperationForm.determinationDate.displayname"/>

<var>
<var-name>datePatternStrict</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
<var>
<var-name>field[0]</var-name>
<var-value>parentCooperation</var-value>
</var>
<var>
<var-name>fieldTest[0]</var-name><var-value>EQUAL</var-value>
</var>
<var>
<var-name>fieldValue[0]</var-name>
<var-value>Parent is NonCooperative</var-value>
</var>
<var>
<var-name>field[1]</var-name>
<var-value>check</var-value>
</var>
<var>
<var-name>fieldTest[1]</var-name><var-value>EQUAL</var-value>
</var>
<var>
<var-name>fieldValue[1]</var-name>
<var-value>true</var-value>
</var>
<var>
<var-name>fieldJoin</var-name>
<var-value>AND</var-value>
</var>
</field>
</form>



Thank you
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: conditional Date field validation in struts validation.xml
 
Similar Threads
validator requiredIf checking two conds
how to design this JSP. need ur suggestion
Validate multiple fields base on a requiredif
validation in tomcat 4.1
On htm:multibox