aspose file tools*
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
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
 
jQuery in Action, 2nd edition
 
subject: conditional Date field validation in struts validation.xml