niels wrote:
Hi,
I want to validate a form:
company field may only be filled if the selected (by radiobutton)
addresstype is equal to CN
I try to do this via:
<form-validation>
<formset>
<form name="addressForm">
<field property="company" depends="validwhen">
<arg0 key="error.company"/>
<var>
<var-name>test</var-name>
<var-value>((*this* != null) and
(addressType=="CN"))</var-value>
</var>
</field>
</form>
</formset>
</form-validation>
without anyl uck..and cannot find any error messages in de log file.
Who can help me?
As written, your validation rule will only pass when company has a value
and addressType is "CN". I think what you want is more like
'((addressType == "CN") or (*this* == null))' -- in other words, company
is valid if it's empty or if addressType is CN. Written this way,
company can be left empty even if addressType is CN. If company is
required when addressType is CN, the rule will be a bit more complicated.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]