We updated our one page checkout to automatically select the card type based on the card number.
However this did not work in IE and it would not update the card type (thus very annoyed customers)
can anyone help me to get this to work in IE as well as the other browsers?
Code:
function CardTypeSelector(num) {
var re = /^4/;
if (re.test(num)) {
$('#CardType').prepend('<option value="Visa" selected=selected>Visa</option>');
}
re = /^5[1-5]/;
if (re.test(num)) {
$('#CardType').prepend('<option value="MasterCard" selected=selected>MasterCard</option>');
}
re = /^(4026|417500|4508|4844|4913|4917)/;
if (re.test(num)) {
$('#CardType').prepend('<option value="VisaElectron" selected=selected>VisaElectron</option>');
}
};
This works perfectly in chrome but sadly the bulk of customers are still on IE.
thanks in advance.