Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

conditional Date field validation in struts validation.xml

 
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
 
Your mind is under my control .... your will is now mine .... read this tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic