For example, of the Commerce 'cart' form, there are 2 submit buttons 'Update cart' and 'Checkout'.

If you click 'Checkout' (2nd submit button) the backend treats it like you clicked the 1st button (Update cart).

This is due to how the submit input elements are rendered.

I've changed the input--submit.html.twig to look like this instead to get it to work:

{{ attributes.value|render }}

I'll try and submit a patch if i get a little extra time.

But as you can see, the input should be outside of the , not inside it.

Comments

Adam Clarey created an issue. See original summary.

  • iamdroid committed 243d94f on 8.x-2.x
    Issue #3211808 by iamdroid: Does not work with multiple submit buttons...
iamdroid’s picture

Status: Active » Fixed

Fixed.

Adam Clarey, I believe the root of the problem was different. Yes, it can be fixed your way but the point was to have an input inside the button. Yes, not an elegant solution but it is the only way to have the markup required by material-components-web.
In this case, the problem was caused by visually-hidden class. Somehow it prevent js of sending op property to determine the button.

Status: Fixed » Closed (fixed)

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