Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example how to link expiry date to month & year dropdowns #154

Closed
miksh7 opened this issue Feb 13, 2015 · 6 comments
Closed

Example how to link expiry date to month & year dropdowns #154

miksh7 opened this issue Feb 13, 2015 · 6 comments

Comments

@miksh7
Copy link

miksh7 commented Feb 13, 2015

It would be very beneficial to have an example showing how to link expiry date to month & year dropdowns. I think this scenario could close questions with the expiry date validation.
Btw, it is feasible in the current release?

@benhinchley
Copy link

👍 This would be awesome, trying to figure out how to do it now, so will post anything I find

@leoetlino
Copy link

I couldn't get it to work with <select>s at all, so I used a dirty hack:

$('#ccexpirymonth, #ccexpiryyear').on('change', function () {
    // Set the value of a hidden input field for Card
    $('#expiry-date').val($('#ccexpirymonth').val() + '/' + $('#ccexpiryyear').val());
    // Trigger the "change" event manually
    var evt = document.createEvent('HTMLEvents');
    evt.initEvent('change', false, true);
    document.getElementById('expiry-date').dispatchEvent(evt);
});

@feliperaul
Copy link

The only reason we are not using this in production yet is because the usability of having a single input for expiration date is so confusing, where user needs to input both Month and Year; nobody seems to know how to go from month to year (should I type a "/" ? it's funny to see they always freeze at this point).

Also it's very common for them to type only the first 2 digits of the year ("19" in the 2019) or try to type the entire year "2019". Even if the form accepts both (it seems to), it's confusing because people never know if they got it right.

It's definitely the biggest friction point.

Anyway we could have it changed to 2 dropdowns <select>without using a hack ?

@jessepollak
Copy link
Owner

I'm going to close this as we'll be adding support for select dropdowns in #173.

@angelflo
Copy link

Hi,

I don't understand why you have closed this issue ... I didn't find anything in the current version who allow something like select#expiry and not input. and their are no sulution in #173 to use month and year dropdown.
Ogone, who's a major payment provider in europe only support month / year dropdown adn we can't use this brillant extension with this payment provider.

leoetlino >> Please can you explain me what you do to make your dirty hack working ?
I can create the hidden field with value="10/19" (for october 2019) but it doesn't update the info in the photo of the credit card ... do you have a solution ?

Thanks a lot

@leoetlino
Copy link

@angelflo that's the piece of hacky code I'm using as a workaround (since one year ago), and it's still working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants