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);
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Status: Active » Needs review
FileSize
1.18 KB

Here's a patch version of your changes.

PhilY’s picture

Issue summary: View changes

Works fine, thank you

NWOM’s picture

Here is a re-roll for the newest dev with a small typo fix

sumthief’s picture

Status: Needs review » Needs work

This 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:

  if (!isset($element['#id'])) {
    $element['#id'] = drupal_html_id('edit-' . implode('-', $element['#parents']));
  }

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.

sumthief’s picture

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

sumthief’s picture

Status: Needs work » Needs review
sumthief’s picture

Status: Needs review » Postponed (maintainer needs more info)

@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)?