You are here

function conditional_fields_set_required_field_recurse in Conditional Fields 6

Recursive function to set required for all conditionally required fields. This causes Drupal to render conditionally required fields in a way that indicates they are required when visible.

1 call to conditional_fields_set_required_field_recurse()
conditional_fields_set_required_field in ./conditional_fields.module
Wrapper for conditional_fields_set_required_field_recurse

File

./conditional_fields.module, line 1094
Content fields and groups visibility based on the values of user defined 'trigger' fields.

Code

function conditional_fields_set_required_field_recurse(&$item) {
  $item['#required'] = TRUE;
  foreach (element_children($item) as $child) {
    conditional_fields_set_required_field_recurse($item[$child]);
  }
}