This was inspired by the discussion in https://backdrop.zulipchat.com/#narrow/stream/218635-Backdrop/topic/.24f...
Consider this form element:
$form['my_checkboxes'] = array(
'#type' => 'checkboxes',
'#title' => t('my Checkboxes'),
'#options' => array(
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
),
'#description' => t('This is the description for the entire set of checkboxes'),
'#default_value' => array(1, 3),
);
One can set descriptions for each individual checkbox, and also disable only one/some of these checkboxes:
$form['my_checkboxes'][1]['#description'] = t('This is the description for the 1st checkbox');
$form['my_checkboxes'][3]['#description'] = t('This is the description for the 3rd checkbox');
$form['my_checkboxes'][2]['#disabled'] = TRUE;
The above would result in this:
Although individual descriptions do not make sense for select elements, there are perfectly valid cases where you need to: - make sure that one/some of the options are disabled/locked (user cannot select them, but they are still shown) - make sure that one/some of the options are selected + at the same time disabled/locked (so that you can force one or more options that must be selected in addition to those that the user can select).
However, if you consider this select element:
$form['my_select'] = array(
'#type' => 'select',
'#title' => t('my Select'),
'#options' => array(
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
),
'#default_value' => array(1, 3),
);
...or this multi-select element:
$form['my_select'] = array(
'#type' => 'select',
'#multiple' => TRUE,
'#title' => t('my multi-Select'),
'#options' => array(
'group1' => array(
1 => 'one',
2 => 'two',
),
'group2' => array(
3 => 'three',
4 => 'four',
),
),
'#default_value' => array(1, 3),
);
Then this has absolutely no effect:
$form['my_select'][2]['#disabled'] = TRUE;
Recent comments
Hello @NumerousHats, I agree with your assessment. I am looking into this situation right now. The root of this problem is that Backdrop CMS is implemented on top of a "stack" of...
Update Core and Theme via Web interface
I just installed a Backdrop CMS site with version 1.27.0. I then used the user interface to download and update Backdrop CMS to 1.30.0. After starting the update process, and on the...
1.30.0 update.php generates incorrect link
I believe my permissions are set up correctly, as I can install modules from the UI. But for whatever reason, I can't update them. I will, however, double check against that documentation.
Update Core and Theme via Web interface