When submitting a form with a Stripe element in it, the stripe.js file (included with the module) submits the entire form with the form.submit() method. This does not preserve the button name which was clicked. If forms have multiple buttons (such as a Webform with both Back and Submit buttons), Drupal will find the first button in the form and act as though that button were clicked.

This could cause other big problems for forms that had File fields on the same form, since they will also end up being the resulting submit handler.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Status: Active » Needs review
FileSize
1.68 KB

This patch adds a hidden element to the form on submit to ensure the button's value is included in the resulting POST request.

hamrant’s picture

Status: Needs review » Reviewed & tested by the community

Good solution

hamrant’s picture

Status: Reviewed & tested by the community » Fixed

  • hamrant committed 9cd7d73 on 7.x-1.x authored by quicksketch
    Issue #2199023 by quicksketch, hamrant: Keep track of clicked button...

Status: Fixed » Closed (fixed)

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