A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

New answers tagged


To use state for checkboxes element, you should target the specific element by JQuery selector, all elements they have the name="field_select_shipping" with value attribute different so try to target the input with both attributes try with the following to show adresse_home only if home and colissimo checkbox checked: $form['input']['adresse_home'] = [ ...


Your approach is right but you have the wrong syntax. $form['input']['adresse_home'] = [ '#type' => 'textfield', '#title' => 'Adresse', '#required' => false, '#states' => [ 'visible' => [ ':input[name^="field_select_shipping"]' => [['checked' => 'true'], ['value' => 'home']], // Omitted the rest. ], ]; ...


You can try this one on Drupal 8: Drupal.behaviors.custom = { attach: function(context, settings) { if(!Drupal.behaviors.custom.click_set){ //Your code. Drupal.behaviors.custom.click_set = true; } } };


So it turns out that it was big pipe, but unrelated to my module. Elsewhere on the page a profile image is loaded to appear next to the user name, and if the user has none, a default image. It seems that if a 404 is returned (in this case because part of the oath did not yet exist to match the path supplied for the image), when big pipe goes to load it and ...

Top 50 recent answers are included