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?



NOTE: using the acquia prosper theme

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

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.

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.

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!

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();

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

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);

Confirmed that this is still an issue.


This appears to fix the issue.

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

Patch attached based on #7

#9 works for me, testing in Chrome

Status:Needs review» Reviewed & tested by the community

#9 works for me.

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