Hi all,
I've a simple
jsp page with 2 textbox [TB1 and TB2] and 2 submit buttons [SB1 and SB2]. TB2 and SB2 is hidden inside a "DIV". Onclick of SB1 it validates TB1 and displayes the DIV part. Similarly SB2 validates TB2.
In
validation.xml I've written like --
<field property="TB1" depends="required">
<msg name="required" key="error.required"/>
<arg0 key="Form.TB1.name"/>
</field>
<field property="TB2" depends="required,validwhen">
<msg name="required" key="error.required"/>
<arg0 key="Form.TB2.name"/>
<var>
<var-name>
test</var-name>
<var-value>((submitButton != SB1))</var-value>
<!-- I've tried using (submitButton == SB2) also -->
</var>
</field>
But it is not working and onclick of SB1 it is displaying error message like "TB2 is required" and "DIV" part is never displayed.
Is my approach all right? Is there any alternate way to validate TB2??
[ March 19, 2008: Message edited by: Bear Bibeault ]