New answers tagged


The contributed module checkboxesjs will do this for you out of the box.


Using #disabled on the submit button is the wrong solution because it communicates to the Drupal form API that the button is not expecting input. In other words, it causes Drupal to act as if the button were not there at all. Hence, clicking the submit button has no effect. This all makes sense from a security perspective, because normally you wouldn't want ...


You can do this by using $form_state->setResponse() together with TrustedRedirectResponse. Create the dropdown, like this: $form['select'] = [ '#type' = 'select', '#title' => t('Select'), '#options' = [ '' => t('Google'), // More links... ] ]; To open the link in a new tab, you can add this to your form: $form['#...


You can use hook_js_alter to replace your JS file (from parent theme) with the one in your child theme.

Top 50 recent answers are included