Skip to content

Commit

Permalink
Fix form submission when we care about the button name/value
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty committed Feb 15, 2023
1 parent fdc6578 commit 4fafc0d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion esp/templates/elements/html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@
$j(function() {
$j('[type=submit]:not(.stripe-button-el)').click(function(){
$j(this).prop('disabled', true);
$j(this).parents('form').submit();
var form = $j(this).parents('form');
<!-- this adds a hidden field in case we care what the button name/value are -->
$j('<input>', {
type: 'hidden',
name: $j(this).prop('name'),
value: $j(this).prop('value')
}).appendTo($j(form));
$j(form).submit();
});
});
</script>
Expand Down

0 comments on commit 4fafc0d

Please sign in to comment.