How to use form states ?

Public

This does work in select, checkboxes

</> CopyGet raw version
php
  1. //field_graphic_type[und] is a select created in UI manage fields in a content type. The [und] is added by default
  2.  
  3. $form['field_graphic_color_haxis'][LANGUAGE_NONE][0]['value']['#states'] = array(
  4. 'visible' => array(
  5. ':input[name="field_graphic_type[und]"]' => array('value' => 'areachart'),
  6. ));