javascript - How to have a single textfield for exp-month and exp-year -
i'm using stripe cc processing , used stripe example form , js code. form has 2 separate fields expiration month , year. each has data-stripe="exp-month"
, data-stripe="exp-year"
i'd use 1 textfield month , year , have user enter input like: 10/2020
question
since stripe reads data based on data-stripe
attribute. there way can parse input 10/2020
1 textfield , programmatically set data-stripe
attributes?
i'm not sure how glued , being sent, have hidden input fields data-stripe="exp-month/year"
attributes , split visible input value on / , set hidden values.
here rather basic jsbin can see month , year in console output.
Comments
Post a Comment