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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

harcher’s picture

Does your form include multiple submit buttons?

Look here
https://drupal.org/node/2035631

greggles’s picture

Status: Active » Postponed (maintainer needs more info)

Based on #1.

I can confirm that this module works fine on my forms that are custom.

Elijah Lynn’s picture

Did 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.

Elijah Lynn’s picture

Interesting, 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

coreyp_1’s picture

I'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 the input selectors.

coreyp_1’s picture

Status: Postponed (maintainer needs more info) » Active

Setting status back to active.

greggles’s picture

Title: Doesn't work or doesn't do anything » Doesn't do anything if the theme uses button instead of input
Status: Active » Needs review
kruser’s picture

Same problem with Bootstrap theme - it uses button for submits.

greggles’s picture

@kruser - can you try out the patch?

dxx’s picture

Patch 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?

agerson’s picture

The patch worked for me also to fix compatibility with a Bootstrap based theme.

greggles’s picture

Status: Needs review » Fixed

Fixed, thanks @coreyp_1 for the patch and everyone else for reviews.

@comexpertise can you open a new issue for that?

  • greggles committed ccc8f4d on 7.x-2.x authored by coreyp_1
    Issue #2035655 by coreyp_1: Doesn't do anything if the theme uses button...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.