Drupal Content Type: how to add a checkbox that hides an object if checked? -
i working on drupal site , want add checkbox within content type hide object if checked.
i not worried how hide it, can figure out js or css later on need know how add checkbox has ability modify display.
i think going along lines of adding new field don't know type of field add.
any appreciated :)
i have done adding form alter,
you need write form alter can add states
property field need show or hide
$form['your_showhide_field']['#states'] = array( 'visible' => array( ':input[name="you_checkbox_name"]' => array('checked' => true), ), );
or
you can use field condition state module this.
Comments
Post a Comment