I have a webform with some fieldsets. Within each fieldset is a set of input elements that are the same for each fieldset, and each set of elements has the same machine name.
One of the elements is a "Select options" as a set of checkboxes. I want to conditionally make some checkboxes readonly or disabled for all of the fieldsets.
My problem is that I have spent hours looking at how to do that, and I cannot find the elements within the
$form object in order that I may alter them. The form is a multi-page form, so that may cause some problems, as I don't know if all of the elements show up in the submitted array until you have reached a specific page or not. I don't know how that works.
Part of my form has something like this:
outer_fieldset -- count -- fieldset_1 -- -- name -- -- date -- -- group -- -- checkboxes -- fieldset_2 -- -- name -- -- date -- -- group -- -- checkboxes -- fieldset_3 ...
die('<pre>' . print_r($form['submitted']['outer_fieldset'], TRUE) . '</pre>'); to look at the data.
$form['submitted']['outer_fieldset']['fieldset_1'] exists, but it doesn't have any elements inside it for the checkboxes or anything.
All the existing SE pages I have looked at give basic answers like
$form['submitted']['element_name']['#attributes']['disabled'] = TRUE;, but I cannot use something like that unless I can find the element objects...
Could the fact that the inner controls all have the same machine name be causing a problem with that? The webform was created using the Drupal interface, and it allows controls to be added this way. I'm relatively new to Drupal. Any help on how to find and alter the attributes of these elements would be great. Thanks.