Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | stripe_remember_button-2199023.patch | 1.68 KB | quicksketch |
Comments
Comment #1
quicksketchThis patch adds a hidden element to the form on submit to ensure the button's value is included in the resulting POST request.
Comment #2
hamrant CreditAttribution: hamrant at DEWEB Studio for Drupal Ukraine Community commentedGood solution
Comment #3
hamrant CreditAttribution: hamrant at DEWEB Studio for Drupal Ukraine Community commented