When a user clicks the submit button, and the form is not valid (e.g. the emial validation fails), i see two submit buttons instead of one. If a user clicks let's say 4 times quickly on the submit button, he'll have 4 buttons for a few seconds. It only lasts for a few seconds until the checkout form is reloaded, but it looks amateuristic.

Most likely it's in the javascript. However, i don't know how to fix it. Any clues?

Members fund testing for the Drupal project. Drupal Association Learn more


mrfelton’s picture

NOTE: using the acquia prosper theme

NOTE 2: This issue was submitted by greatfield in http://www.ubercart.org/node/4987#comment-62300

mrfelton’s picture

Suggested fix by mettasoul:

Same problem here. I fixed it by changing line 13 in uc_optional_checkout_review.js (- remove line, + add line)

- $(this).clone().attr('disabled', true).insertAfter(this).after(' ').end().end().hide();

+ $(this).clone().insertAfter(this).attr('disabled', true).after(' ').end().hide();

Hope this helps. Great little module btw! Thanks.

mrfelton’s picture

Status: Active » Postponed (maintainer needs more info)

I'm unable to reproduce this issue in Chrome, Firefox or IE using Garland, my own custom theme or acquia proposer.

You'll need to provide some more details about your setup.

greatfield’s picture

Mettasoul's solution is working, i ended up on line 13 with:

$(this).clone().insertAfter(this).attr('disabled', true).after('    ').end().hide();

I experienced the problem in chrome, didn't test any other browsers. The theme i use is the stock acquia prosper theme, didn't test on others. I have many modules installed. The ones about checkout are a custom module with a hook to remove the cancel button, checkout tweaks, and terms and conditions.

Anyhows it's working now! Thanks!

DrunkMunki’s picture

i can confirm its doing the same with a custom template (template shouldnt matter since its using the default UC checkout page), drupal 6.20 with UC 6.x-2.4.
tried changing the code but still products duplicate button, tried with firefox 4.
clicking on the buttons adds another submit button, doing it several times adds several buttons.
the order goes through but the user is then sent to a page stating:
There are no products in your shopping cart.

i have tried both variations of the below code.

$(this).clone().insertAfter(this).attr('disabled', true).after('  ').end().hide();
$(this).clone().insertAfter(this).attr('disabled', true).after(' <span class="ubercart-throbber">&nbsp;&nbsp;&nbsp;&nbsp;</span>').end().hide();
arski’s picture

sub - this happens on any submit for me, regardless if its a success or not.

ebrelsford’s picture

I fixed this by getting rid of those evil end() calls and just explicitly hiding $(this) after cloning it. This has the benefit of still showing the throbber (unlike other solutions above):

$(this).clone().attr('disabled', true).insertAfter(this).after('<span class="ubercart-throbber">&nbsp;&nbsp;&nbsp;&nbsp;</span>'); 
$('#uc-cart-checkout-form #edit-cancel').attr('disabled', true);
trothwell’s picture

Confirmed that this is still an issue.


This appears to fix the issue.

toemaz’s picture

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

Patch attached based on #7

mattcasey’s picture

#9 works for me, testing in Chrome

attheshow’s picture

Status: Needs review » Reviewed & tested by the community

#9 works for me.

arski’s picture

works great for me too.. any chance of having this committed?