Validation at time of clicking PayPal Express Checkout button - onClick()

gardavis
Contributor
Contributor

This demo shows some validation but not exactly what I need. https://developer.paypal.com/demo/checkout/#/pattern/validation

 

I would like to do some validation at the time the PayPal button is clicked (like was the zip code field filled in correctly or is the user logged on). The Validate() is called once, basically when the page is loaded. That's too early to validate. The onClick() function is called when the button is clicked and a good place to do my validation but I don't have a way to continue if valid and display the error if not.

 

The demo uses a checkbox event within the scope of the validate() function so it is able to enable/disable the PayPal popup (onClick() still works if disabled). The demo's onClick() simply shows/hides the error message.

 

Does anyone know how to do validation within onClick() or is that too late to enable/disable?

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.