I don't see a way to do this with the standard validators - I think
you'll have to write your own.

Niall

On 3/17/06, Achim Willems <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a text field that depends on the value of a select box.
>
> Generally, the text field needs no validation (i.e. every text is
> allowed), but when the select box has a special value (in my case it is
> "text.birthday"), I want a validator to confirm that the text entered is
> a date.
>
> I thought about a combination of "validwhen" and "date" (see example
> below) The condition only allows that the text field might be empty in
> some circumstances, but if the field is not empty it must be a date.
>
> Do I have to write an own validator for this, or is there a way to do
> this with the standard validators?
>
> Thanks and regards, Achim
>
> <form name="searchContactForm">
>    <field property="value" indexedListProperty="elements"
>           depends="validwhen,date" page="1">
>        <arg key="editContact.birthday" />
>        <var>
>            <var-name>test</var-name>
>            <var-value>((elements[].field != 'text.birthday') or
>                        ((elements[].field == 'text.birthday') and
>                         (*this*!=null)))</var-value>
>        </var>
>        <var>
>            <var-name>datePatternStrict</var-name>
>            <var-value>dd/MM/yyyy</var-value>
>        </var>
>    </field>
> </form>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to