I need to add ajax validations in the checkout page when the users click on the Continue button in each checkout step. Does anyone know if this is possible?
I need to send the Cart object, Address, items, etc. The idea is, the users are unable to continue, if they fail the validation.
2
Answers
You can only do this if you are on Shopify Plus. You cannot inject Javascript into checkout for the very good reason that you’d probably break it! It is a finely tuned machine, so the most you can do usually is change some css classes.
If you have Shopify Plus, then you can insert your js form validation.
Also you have to replace the given input id with you custom id. After which, you can insert, check and get data from input fields
Below is script for phone number validation