Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As the title says. It was disabling/hiding one of the buttons but not the very last submit button at the bottom (ie. the primary submit button). So I made a change to the js file that comes with the module:
if (settings.hide_submit_hide_fx)
{
//$('input.form-submit', $form).addClass(settings.hide_submit_css).fadeOut(100).eq(0).after(pdiv);
//$('input.form-submit', $form).next().fadeIn(100);
$('#edit-actions input.form-submit', $form).addClass(settings.hide_submit_css).fadeOut(100).eq(0).after(pdiv);
$('#edit-actions input.form-submit', $form).next().fadeIn(100);
}
else
{
//$('input.form-submit', $form).addClass(settings.hide_submit_css).hide().eq(0).after(pdiv);
$('#edit-actions input.form-submit', $form).addClass(settings.hide_submit_css).hide().eq(0).after(pdiv);
}
Comment | File | Size | Author |
---|---|---|---|
#5 | hide_submit-multiple_submit_disable-2035631-5.patch | 1.99 KB | sumthief |
#3 | hide_submit-submit-button-not-2035631-3.patch | 1.82 KB | NWOM |
#1 | 2035631_hide_all_buttons_in_form.patch | 1.18 KB | greggles |
Comments
Comment #1
gregglesHere's a patch version of your changes.
Comment #2
PhilYWorks fine, thank you
Comment #3
NWOM CreditAttribution: NWOM commentedHere is a re-roll for the newest dev with a small typo fix
Comment #4
sumthief CreditAttribution: sumthief as a volunteer and at DrupalJedi commentedThis patch looks not good.
Because identifier which you want to use as a base (parent) element for searching in is not reliable.
I mean that if you'll check includes/form.inc and find function "form_builder" and check this code then you will see what I am talking about:
Identifier #edit-actions will be generated for the form element which contained in 'actions' key. But if somebody will define element with type 'actions' but put it into the 'buttons' (for example) key we will get '#edit-buttons' identifier.
So this patch is not suitable for us.
Comment #5
sumthief CreditAttribution: sumthief as a volunteer and at DrupalJedi commentedTried to make a patch with no dependency on element id.
It appends progress indicator to each button. But I don't sure that this is the source issue.
P.S.: Pastebin for reproduce problem - http://pastebin.com/dmh0NbBQ.
Comment #6
sumthief CreditAttribution: sumthief as a volunteer and at DrupalJedi commentedComment #7
sumthief CreditAttribution: sumthief as a volunteer and at DrupalJedi commented@hga77
Please could you provide more information how to reproduce the problem (for example you can give us form example from core or contrib, or code snippets)?