I read How to unset fieldset in hook_form_alter? to disable fieldsets in an hook_form_alter()
implementation, but it didn’t work.
I tried using the following code, but neither of them worked.
// First try. foreach ($form['#fieldgroups']['group_employment']->children as $form_element_id) { $form[$form_element_id]['#attributes']['disabled'] = TRUE; }
// Second try foreach ($form['#fieldgroups']['group_employment']->children as $form_element_id) { $form[$form_element_id]['#attributes']['disabled'] = 'disabled'; }
How can I disable fieldsets?