@Chrisesbueno
Posted
R-1 You can use regular expressions to validate the input field of the card numbers and thus get the space to be created, you can also use array methods to cut the input string every time four digits are typed and then join them with the space, here I leave you how it would be done with regular expressions, which is how I did it: (your input card number).value = (your input card number).value.replace(/\s/g, '').replace(/(.{4})/g, '$1 ').trim();
R-2 I don't quite understand what you mean by this question.
Marked as helpful
@Godspower12
Posted
@Chrisesbueno Thank you so much, I appreciate this, my second question was about input field being active I.e when my keypad becomes visible in mobile view. It kind of changes the sizes of the cards. Thank you.