Your no. 1 source for ehmmmm... No clue! Just needed a place to put downloads and to recreate test environments to help others.

Log in

Login to your account

Username *
Password *
Remember Me

Adding the attribute showon allows to hide the field based on the value(s) of another field.

Syntax to show the field "bar" only when "foo" is set to "1":

<field
    name="foo"
    type="list"
    >
    <option value="1">JYES</option>
    <option value="0">JNO</option>
</field>
<field
    name="bar"
    type="text"
    showon="foo:1"
/>

To match multiple values one can provide a comma-separated list of values. Like showon="foo:1,2".

To combine multiple fields you can use [AND]. Like showon="foo:1[AND]bar:1".

Syntax to show the field "bar" only when "foo" is set to "1" and "baz" is set to "1":

<field
    name="foo"
    type="list"
    >
    <option value="1">JYES</option>
    <option value="0">JNO</option>
</field>
<field
    name="baz"
    type="list"
    >
    <option value="1">JYES</option>
    <option value="0">JNO</option>
</field>
<field
    name="bar"
    type="text"
    showon="foo:1[AND]baz:1"
/>

To create a choice between multiple fields you can use [OR]. Like showon="foo:1[OR]bar:1".

Syntax to show the field "bar" only when "foo" is set to "1" or "baz" is set to "1":

<field
    name="foo"
    type="list"
    >
    <option value="1">JYES</option>
    <option value="0">JNO</option>
</field>
<field
    name="baz"
    type="list"
    >
    <option value="1">JYES</option>
    <option value="0">JNO</option>
</field>
<field
    name="bar"
    type="text"
    showon="foo:1[OR]baz:1"
/>