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.
Does this work for custom forms (with drupal_get_form) ?
I installed and configured the extension, but nothing happens. It doesn't hide buttons. Although I can see that hide_submit.js is loaded, it has no effect.
Comment | File | Size | Author |
---|---|---|---|
#5 | hide_submit-support_button_tag-2035655-5.patch | 2.96 KB | coreyp_1 |
Comments
Comment #1
harcher CreditAttribution: harcher commentedDoes your form include multiple submit buttons?
Look here
https://drupal.org/node/2035631
Comment #2
gregglesBased on #1.
I can confirm that this module works fine on my forms that are custom.
Comment #3
Elijah LynnDid you try hide and disable?
Disable for me appears to do nothing and is not grayed out like I would expect but does in fact get disabled. Hide actually hides and shows the replacement text in most forms, not custom forms though, it hides but the replacement text never shows.
Comment #4
Elijah LynnInteresting, I made a custom module to use hook_hide_submit_alter() and now it isn't working the way it was before. I tried disabling > uninstalling > reinstalling but no cigar.
I will continue to investigate.
p.s. This is on admin/config/content/hide-submit
Comment #5
coreyp_1 CreditAttribution: coreyp_1 commentedI'm pretty sure that this has to do with the theme.
Some themes (like ZURB Foundation) don't use the
<input />
tag, but use<button />
instead.For me, the simple fix was to add
button
alternatives to theinput
selectors.Comment #6
coreyp_1 CreditAttribution: coreyp_1 commentedSetting status back to active.
Comment #7
gregglesComment #8
kruser CreditAttribution: kruser commentedSame problem with Bootstrap theme - it uses button for submits.
Comment #9
greggles@kruser - can you try out the patch?
Comment #10
dxx CreditAttribution: dxx commentedPatch ok!
But for compatibility with Drupal Commerce, I need to add: "#edit-buttons input.form-submit, #edit-buttons button.form-submit" for each lines.
Why this line "$('input.form-submit, button.form-submit', $form).attr('disabled', 'disabled').each(function (i) {" has not edited into this patch for use new selectors?
Comment #11
agerson CreditAttribution: agerson commentedThe patch worked for me also to fix compatibility with a Bootstrap based theme.
Comment #12
gregglesFixed, thanks @coreyp_1 for the patch and everyone else for reviews.
@comexpertise can you open a new issue for that?