disable, enable and onclick functions do not work PayPal's Pay button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a form that must be valid before clicking "Pay Now" button.I want to keep the button disable until the form is valid.
There is some issues about it. There is a link about "onClick" function.It's working but when I click "Pay now" button, inside of the onClick buttons work and also payment keeps working I mean there is no way to cancel by me for an invalid form.Actually onClick function has no effect to payment side.
There are also different solutions like "actions.disable()" and "actions.enable()" but these functions do not work at all.
There are also "actions.resolve()" and "actions.reject()" functions but they do not work as well.
Here is the link about onClick, resolve and reject functions: https://developer.paypal.com/docs/checkout/integration-features/validation/#asynchronous-validation
Here is the link about disable and enable functions: https://developer.paypal.com/docs/checkout/integration-features/validation/#synchronous-validation
I really did not understand that how they can make doc about them that don't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that you have to do this:
It's really annyoing.
validate : function(actions) {
t.paypalActions = actions; // store the actions
t.paypalActions.disable(); // disable by default
//--- MAKE EVENT THAT WILL PERIODICALLY CHECK YOUR FORM ON EVERY CHANGE AND MAKE THE BUTTONS ENABLED / DISABLED PRIOR TO USER CLICKING
},
onClick: function(data) {
// when this is called, it is already too late to allow / disable the action!!
}

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- p is not a function error using the example downloaded from Paypal in SDKs
- Third Party API Adyen Paypal integration not functioning. in NVP/SOAP APIs
- godaddy with payment paypal but can't function in PayPal Payments Standard
- How to disable the Pay Later function when using the PayPal Business integration on Formsite in PayPal Payments Standard
- I got an error with saving paypal during payment function in REST APIs