#joe-elements-name

1 messages · Page 1 of 1 (latest)

earnest cloud
ashen harness
#

I tried the example in the customized fields:
var paymentElement = elements.create('payment', {
fields: {
billingDetails: {
name: 'never',
email: 'never',
}
}
});
But that didn't work

earnest cloud
#

But I linked you to a different part of the doc since you asked about pre-filling which seems like a different question?

ashen harness
#

It is, I was just hoping it was the same format

#

Do you have an example of say pre-filling name?

earnest cloud
#

what have you tried though?

#

Sorry but I just linked you to the exact doc, can you explain what's not working?

ashen harness
#

var paymentElement = elements.create('payment', {
fields: {
billingDetails: {
name: 'Joe Adroit',
email: 'joe@test.com',
}
}
});

earnest cloud
#

fields expects auto or never as value. You can't pre-fill those here

#

I linked you to a different part of the doc

#

so you pass defaultValues like this: defaultValues: { billingDetails: { name: 'Prefilled Doe', }, },

#

does that make sense?

ashen harness
#

Perfect, Thanks!

earnest cloud
#

sure! Let me know if that doesn't work!

ashen harness
#

It worked