#sanjeewa
1 messages · Page 1 of 1 (latest)
Hi, how can we continue to help?
May I know the status here? Also has mentioned set readOnly on creation
Can you guide me to sort this?
Hey I just catchup on this. Yes we are still fixing this, but in the mean time have you been able to mitigate by setting readOnly on creation instead of update?
This is my code, Can you assist me here how to set readOnly on creation?
on your elements.create('payment') line pass the readOnly option
var paymentElement = elements.create("payment", {readOnly: true});
But when I try this I cannot enter card details at all ☹️ , I want to disable the field when payment is processing .
Like we disabled submit button
On your original code you were calling paymentElement.update right after creation, don't you?
No ,I removed it & added creation line as you mentioned
Yes, but I mean originally we were also update the readOnly right after creation, correct? That way you also will disbale the field before entering card detail
But my requirement is disable the field when I click pay button, not before entering the card details.
I was trying individual payment field to be disabled as below
$("#Field-numberInput").prop( "disabled", true );
but not working
Is it not possible handle any event externally by using field ID what comes from paymentElement ?
No that probably not possible. If your requirement is disable the field when you click pay button, the paymentElement.update({ readOnly: true }) should work, doesn't it? because it's way after initialization and no race condition will run
I will check this
Yes it is working now 🙌