[EDIT]
I was wrong in my answer below. I will not delete it (yet) because I got 7 upvotes on this :). But I'm editing it so you all have the chance to retract your vote (even downvote it, because I deserve it).
Original Answer
Ha!..I found it.
Short answer: You cannot!
Long answer: You should be able to do it if someone would have known the difference between an array and an object.
In theory this should work
<field1>
....
</field1>
<field2>
....
<depends>
<field1>
<value>1|2</value>
<separator>|</separator>
</field1>
</depends>
</field2>
But in the code that handles the dependency, Mage_Adminhtml_Block_System_Config_Form::initFields
around line 366 there is this code
if (isset($dependent['separator'])) {
$dependentValue = explode((string)$dependent['separator'], $dependentValue);
}
$dependent
is always an object so $dependent['separator']
is never set.
If I change the code above to
if (isset($dependent->separator)) {
$dependentValue = explode((string)$dependent->separator, $dependentValue);
}
everything works smoothly.
I guess I cannot change the core just for the sake of an extension so I have to create 2 fields instead of 1, one for each value from field1
or create a custom js that handles this and add it to the config page.