Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

conditional Date field validation in struts validation.xml

 
satish sat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic