Programmatically set expirationMonth options
See original GitHub issueI’m using different languages on my checkout form and I’d like to change the options array programmatically. Is it possible to do something like this? How do I change the select options on the expirationMonth?
I’m trying to do something like this. But doesn’t work.
months = ['some', 'date', 'options'] ;
hostedFieldsInstance.setAttribute({
field: 'expirationMonth',
attribute: 'select',
value: { options: months }
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to have a single textfield for exp-month and exp-year
Is there a way I can parse the input 10/2020 from one textfield and programmatically set the data-stripe attributes?
Read more >HostedFields - Documentation - Braintree Open Source
The Hosted Fields create options. ... Programmatically focus a field. ... Sets the month options for the expiration month field when presented as...
Read more >How to programmatically insert/update/delete an option...
I am trying to write a program to programmatically insert/update/delete an option in OptionSet ... Same classes will work for global or local...
Read more >Class: Field
Programmatically set user focus to the Microform input field. Example ... New options will be merged into the existing configuration of the field....
Read more >LinearLayout
Set android:orientation to specify whether child views are displayed in a row or ... that this view can be autofilled with a credit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re correct that this is not functionality currently supported by the SDK.
If this is added, I don’t think set attribute is the correct spot, since that is designed to mirror the set attribute api, and option elements within a select cannot be updated that way. We’d need to expose a new method to accomplish it.
I can see the use case, so I’ll bring it up with the rest of the team.
This was added in 3.47.0
https://braintree.github.io/braintree-web/current/HostedFields.html#setMonthOptions