• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Validator validwhen question

 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am trying to use the validwhen tag of the struts validator fwk
In my validation.xml i have
<field property="occupation" depends="validwhen, required">
<arg0 key="prompt.degreeOccupation"/>
<var>
<var-name>test</var-name>
<var-value>((occupation != null) and ((profession == 15) or (profession == 12)))</var-value>
</var>
</field>
I expect the validation to be done only in case my occupation is not null and the profession id is either 15 or 12 but the error message shows up when my profession is 10
What is happening here :roll:
Anyone
 
All of the following truths are shameless lies. But what about this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic