devdocs
devdocs copied to clipboard
JS error from incorrect code sample
General issue
The tutorial described in this doc results in a JS error
https://devdocs.magento.com/guides/v2.4/howdoi/checkout/checkout_form.html
Description:
Followed the 3 steps of the tutorial to add new form to checkout
Form correctly displayed in Checkout / Shipping step
Clicking on the "Submit" button results in the following error :
Uncaught TypeError: this.source is undefined
onSubmit .../Vendor/default/fr_FR/Vendor_Module/js/view/custom-checkout-form.js:22
init .../Vendor/default/fr_FR/knockoutjs/knockout.js:4669
jQuery 6
Possible solutions:
Add in config
<item name="provider" xsi:type="string">checkoutProvider</item>
As in
<item name="config" xsi:type="array">
<item name="provider" xsi:type="string">checkoutProvider</item>
<!-- And this to add your html template -->
<item name="template" xsi:type="string">Vendor_Checkout/custom-checkout-form</item>
</item>
Hi @baoutch. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Dupe or related to https://github.com/magento/devdocs/issues/9287
@dobooth the issue was fixed in the pull request https://github.com/magento/devdocs/pull/9298