#sanjeewa

1 messages · Page 1 of 1 (latest)

mild mantleBOT
magic talon
#

Hi, how can we continue to help?

broken helm
#

May I know the status here? Also has mentioned set readOnly on creation

#

Can you guide me to sort this?

magic talon
#

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?

broken helm
#

This is my code, Can you assist me here how to set readOnly on creation?

magic talon
#

on your elements.create('payment') line pass the readOnly option

#
var paymentElement = elements.create("payment", {readOnly: true});
broken helm
#

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

magic talon
#

On your original code you were calling paymentElement.update right after creation, don't you?

broken helm
#

No ,I removed it & added creation line as you mentioned

magic talon
#

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

broken helm
#

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 ?

magic talon
#

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

broken helm
#

I will check this

broken helm
#

Yes it is working now 🙌