Instead of

<select id="edit-my-name-select-1" class="shs-select form-select shs-select-level-1" style="display: inline-block;">

---

<select id="edit-my-name-select-1" class="shs-select form-select shs-select-level-1" name="my_name" style="display: inline-block;">

Not sure if there is a need to differentiate levels with different names

Comments

PlayfulWolf’s picture

Priority: Minor » Normal

Not sure if this is related but code like:

$form['field_name']['#options']['All'] = t('My custom text');

does not work on SHS Views filter.

stBorchert’s picture

Status: Active » Closed (works as designed)

I don't see a need to add the name attribute here, since the original (hidden) element still have it. For theming, you don't need the name either.

To override the option for value "All", see hook_shs_js_settings_alter().

Allan.ordogh’s picture

You need a name attribute if you want to use #states:

$form['my_field']['#states']['disabled'] = [
        ':input[name="my_shs_field"]' => ['value' => '_none']
];