How to Auto Format Card Field


#1

Hi all!

I am trying to build a prototype that features a field for credit card number. I would like the field to autoformat card information as a user types it in so it will look like this: “1234 5678 9012 3445” with the spaces in between autofilled. The card lengths for this prototype will only be 16 digits, so I would like the numbers to be in four, four digit segments.

Does anyone know how I would do this? Thank you all!


#2

Maybe you need to use the substr() function


#3

I am trying to figure out how I would manipulate the string commands to add spaces in intervals. Any suggestions?


#4

You can use .concat() and .substr()

Auto Format Card Field_Jorkin.rp (46.5 KB)