What you have specified means that the custName field is only valid when the
checkbox is set and custName is not null - you also want it to be valid when
the checkbox is not set
Try the following...
<var>
<var-name>test</var-name>
<var-value>((order != 'true') or (*this* != null))</var-value>
</var>
Niall
----- Original Message -----
From: "fea jabi" <[EMAIL PROTECTED]>
Sent: Monday, November 21, 2005 4:28 PM
> Have a jsp with a checkbox.
>
> If this is checked have to make sure 2 other textfields are not empty.
>
> i.e if order checkboxs checked want to make sure that the custName and
the
> custNumber are entered.
>
> Is the below right to do the same?
>
> <formset>
> <form name="SetupForm">
> <field property="custName" depends="validwhen">
> <var>
> <var-name>test</var-name>
> <var-value>((order == 'true') and (*this* !=
> null))</var-value>
> </var>
> </field>
> </form>
> </formset>
> <formset>
> <form name="SetupForm">
> <field property="custNumber" depends="validwhen,integer">
> <var>
> <var-name>test</var-name>
> <var-value>((order == 'true') and (*this* !=
> null))</var-value>
> </var>
> </field>
> </form>
> </formset>
>
> In JSp
> ................
> ..................
>
> <!-- 12. Customer Name -->
> <tr>
> <td>
> <bean:message key="lbl.custName"/> <bean:message
> key="colon"/>
> </td>
> <td>
> <html:text name="SetupForm" property="custName"
> size="40" />
> </td>
> <td align="bottom">
> <font color=red><html:errors
> property="custName"/></font>
> </td>
> <td></td>
> </tr>
> <tr></tr><tr></tr><tr></tr>
> <!-- 12.customer Number -->
> <tr>
> <td>
> <bean:message key="lbl.custNumber"/> <bean:message
> key="colon"/>
> </td>
> <td>
> <html:text name="SetupForm" property="custNumber"
> size="40" />
> </td>
> <td align="bottom">
> <font color=red><html:errors
> property="custNumber"/></font>
> </td>
> <td></td>
> </tr>
>
> .................
> ............
> <html:javascript formName="SetupForm"/>
> </html:form>
>
> I tried deploying. But on submit. I don't think the validation is getting
> checked. I checked the checkbox but left the the textfields blank. But it
> just forwards to the next jsp.
>
> what am I missing?
>
> Also, Would like to make sure the number entered inthe custNumber is
> positive integer. How can this be done?
>
> Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]