Skip to content

Commit 4fafc0d

Browse files
committedFeb 15, 2023
Fix form submission when we care about the button name/value
1 parent fdc6578 commit 4fafc0d

File tree

1 file changed

+8
-1
lines changed
  • esp/templates/elements

1 file changed

+8
-1
lines changed
 

‎esp/templates/elements/html

+8-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,14 @@
8181
$j(function() {
8282
$j('[type=submit]:not(.stripe-button-el)').click(function(){
8383
$j(this).prop('disabled', true);
84-
$j(this).parents('form').submit();
84+
var form = $j(this).parents('form');
85+
<!-- this adds a hidden field in case we care what the button name/value are -->
86+
$j('<input>', {
87+
type: 'hidden',
88+
name: $j(this).prop('name'),
89+
value: $j(this).prop('value')
90+
}).appendTo($j(form));
91+
$j(form).submit();
8592
});
8693
});
8794
</script>

0 commit comments

Comments
 (0)
Please sign in to comment.