#deaa
1 messages · Page 1 of 1 (latest)
What do you mean by 'disable'? Prevent clicking of a specific wallet button?
You probably want to do something similar to this: https://stripe.com/docs/stripe-js/elements/payment-request-button?client=html#html-js-mount-element
Where you check for a valid input and then apply a disable attribute to the document element
yes
but not working
i used this code
apple_pay_button.on('click', function(event) { console.log('apple_pay_button click'); console.log('apple_pay_button clicked', _self.processing); if (_self.processing) { console.log('apple p[ay] stooped'); event.preventDefault(); return; } });
but the event not firing
Indeed, click isn't a valid event: https://stripe.com/docs/js/payment_request/events
You're going about this the wrong way. Check the link I sent, you need to track validity of your input(s) and apply attributes/styling accordingly via JS
There's no specific example for how to do that, you'd need to adapt the code to fit your requirements
i need to check after setup the stripe button
so i need way like "clieck" event to check
or can i disable the button based on another input
like this
apple_pay_button.disable();
No, there's no disable method or similar. You'll need to use JS to look up the HTML element where you mount the button and disable it. Maybe:
btn.setAttribute('disabled', true)
ok, thank you
i will try it