question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Programmatically set expirationMonth options

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
crookedneighborcommented, Oct 9, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found