Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

validwhen struts ???  RSS feed

Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have 2 fields on my screen, 1 is a textfield and the other is a drop-down.
When the drop-down has values A or B or C, the value allowed in the textfield should be a long only.
When the user selects anything else other than A,B,C from drop-down, the textfield can contain anything.

I am trying to use validwhen.

<field property="selectedDropDownItem" depends="validwhen">
<msg key="error.invalid" name="validwhen"/>
<var-value>( ((*this* == 'A' ) and (id == [a-zA-Z])) or ((*this* == 'B' ) and (id == [a-zA-Z])) or ((*this* == 'C' ) and (id == [a-zA-Z])))</var-value>
id=[a-zA-Z] doesnt work nor does id =long.
How do I give id field a different validation rule only when selectedDropDownItem = A or B or C ?

Any help will be apprecaited.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!