Skip to content

Instantly share code, notes, and snippets.

@jonathanfranks
Created March 5, 2015 18:35
Show Gist options
  • Save jonathanfranks/f41c2bc5c21d4e8b5927 to your computer and use it in GitHub Desktop.
Save jonathanfranks/f41c2bc5c21d4e8b5927 to your computer and use it in GitHub Desktop.
Drupal #states or conditions
$form['my_field']['#states'] = array(
'visible' => array(
array(
array(':input[name="field_other[und]"]' => array('value' => 'first')),
'or',
array(':input[name="field_other[und]"]' => array('value' => 'second')),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment