Answer the question
In order to leave comments, you need to log in
Map input not working on android?
There is a field
<input type="text" class="cardnumber" name="cardcode" pattern="[0-9]{4}\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}" placeholder="XXXX XXXX XXXX XXXX">
var cc = myform.cardcode;
for (var i in ['input', 'change', 'blur', 'keyup']) {
cc.addEventListener('input', formatCardCode, false);
}
function formatCardCode() {
var cardCode = this.value.replace(/[^\d]/g, '').substring(0,16);
cardCode = cardCode != '' ? cardCode.match(/.{1,4}/g).join(' ') : '';
this.value = cardCode;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question