Magento CE 1.7.0.2 – System.xml Field Dependency

ce-1.7.0.2system.xml

So you can set in the system.xml file of a module a dependency between fields by adding a <depends> tag in one of the fields.

<field1>
    ....
</field1>
<field2>
    ....
    <depends>
       <field1>1</field1>
    </depends>
</field2>

The code above means that field2 will be shown when the value of field1 is 1.
I want to know how/if can I tell Magento to show field2 if the value for field1 is 1 OR 2?

Best Answer

Try this:

<depends>
    <field separator="|">
        <value>1|2|3</value>
    </field>
</depends>
Related Topic