I am working on a project where I have the need to validate a checkbox being 
'on' . It is the usual accept our license, or you cannot enter site. In the jsp 
page we are using this:
<tr><td colspan=4><br><html:checkbox property="terms" value="0"/>
 
And in my bean I have a getter and setter with a boolean value:
eg:
setTerms(boolean val)
boolean getTerms()
 
and in my validation.xml I have this:
 <field property="terms" depends="validwhen">
        <arg key="requestaccount.terms.displayname"/>
        <var>
          <var-name>test</var-name>
          <var-value>(*this* != null)</var-value>
        </var>
    </field>
 
But, if the user does not check this checkbox, the validator does not seem to 
catch it?
 
Can anyone give me some advice here?
 
Thanks,
 
Scott

Reply via email to