Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
62
rated 0 times [  65] [ 3]  / answers: 1 / hits: 18489  / 9 Years ago, sat, february 28, 2015, 12:00:00

I need to insert a space after every four characters while the user is typing a credit card number using JavaScript .



<input type=text size=19 maxlength=19 data-stripe=number placeholder=1234 5678 9012 3456>


What is the best way to accomplish this ?


More From » html

 Answers
59

you can use a jquery and mask for it please check it jquery and mask
for jquery you only need put a mask



$(#date).mask(9999 9999 9999 9999);


check it


[#67629] Thursday, February 26, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
levidaylonj

Total Points: 392
Total Questions: 100
Total Answers: 112

Location: Bahrain
Member since Fri, Sep 16, 2022
2 Years ago
;