Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

requiredif

Status
Not open for further replies.

francisd

Programmer
Apr 8, 2006
1
US
HOw do I use requiredif, I tried following the example, but it makes no sense to me? I know validwhen is knew but the application i'm developing on still uses struts 1.03, basically, I have field (selection box) , that when a paticular selection is chosen another field text box must filled out ... meaning it becomes mandatory.

Here is my validation.xml

<form name="FAULTREASON"
bundle="FrameworkResources">

<field property="FAULTREASON" depends="requiredif">
<arg0 key="FAULTREASON" resource="false"/>
<var>
<var-name>field[0]</var-name>
<var-value>provstatusid<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>10</var-value>
</var>
</field>
</form>


FAULTREASON is the text box, and provisionstatusid is a selection box , I basically want when the provisionstatusid is set to 10 (value) not the option text, then the faultreason should be set.

Also, how does the field, fieldtest, fieldvalue stuff work, and mean, as I was just following the example given on the struts site.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top