I would like to keep my “Complete Purchase” button disabled/grayed out until the user has entered populated the necessary credit card fields and the data is ready for tokenization/sending to Square.
Is there any way of doing this?
I know I have access to the credit card error message (and error classes are added to that element). However, it appears that this element has the exact same state “sq-card-message sq-card-message-no-error” when the form is completely blank, or when it is filled out correctly and ready for submission. There appears to be no way of detecting if the form has been correctly populated and is ready for tokenization/submission.
For now, I’m just enabling the purchase button if they are paying by credit card, but I would rather keep the button disabled until the credit card payment is ready for submission/tokenization.