Skip to content

Commit 9db694b

Browse files
committed
PSPAYPAL-915 Credit card validation
Call `dispatchEvent(new CustomEvent('submit', {cancelable: true}));` instead of `sudmit` method in order to trigger submit event and hence form validation.
1 parent c87e5a4 commit 9db694b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

views/smarty/frontend/blocks/page/checkout/checkout_order_btn_submit_bottom.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
submitButton.addEventListener('click', function() {
99
event.preventDefault();
1010
this.disabled = true;
11-
orderConfirmAgbBottom.submit();
11+
orderConfirmAgbBottom.dispatchEvent(new CustomEvent('submit', {cancelable: true}));
1212
});
1313
[{/capture}]
1414
[{oxscript add=$smarty.capture.oscpaypal_madClickPrevention}]

views/twig/extensions/themes/default/page/checkout/order.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
submitButton.addEventListener('click', function(event) {
8282
event.preventDefault();
8383
this.disabled = true;
84-
orderConfirmAgbBottom.submit();
84+
orderConfirmAgbBottom.dispatchEvent(new CustomEvent('submit', {cancelable: true}));
8585
});
8686
{% endcapture %}
8787
{{ script({ add: oscpaypal_madClickPrevention, dynamic: __oxid_include_dynamic }) }}

0 commit comments

Comments
 (0)