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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -