Form Element States module provides a field widget for all core field types to add state properties into it. Common use cases is some fields need to be visible/hide/required depends on other field value.
To submit bug reports and feature suggestions, or to track changes visit https://www.drupal.org/project/issues/form_element_states
This module requires field module from Drupal core.
Install the Form Element States module as you would normally install a contributed Drupal module.
1. Navigate to Administration > Structure > Content Types 2. Go to manage form display to any content type. 3. Select widget from select list(eg:textfield with states) from field row. 4. Add states property in the textarea(State properties) 5 Add each state property in new line. Example :- visible|field_toogle|checked|TRUE
- visible - state action
- field_toogle - field name
- checked - condition
- TRUE - Condition value
For more help how states are in drupal Form element https://api.drupal.org/api/drupal/core!includes!common.inc/function/drupal_process_states