cleave.js icon indicating copy to clipboard operation
cleave.js copied to clipboard

Mask credit card number?

Open Vali0 opened this issue 6 years ago • 4 comments

Is it possible to mask credit card number i.e. ************4141

It looks like with default options library strips asterisks so I wondered if there is any option that could change that?

Regards, Vali0

Vali0 avatar Sep 13 '19 11:09 Vali0

You could use a password field to hide the contents. However hiding a part of text input is not supported by HTML.

radiantshaw avatar Dec 02 '19 10:12 radiantshaw

Hi @Vali0 , could you find a solution for your question? I also would like to show just the last number of the credit card that is being typed: XXXX XX2

msahores avatar Mar 17 '20 23:03 msahores

You could use a password field to hide the contents. However hiding a part of text input is not supported by HTML.

@radiantshaw Could you please give an example how to use password field? I tried with type="password" but it didn't work.

RoosterH avatar Dec 03 '20 18:12 RoosterH

@Vali0 I guess you're being confused about the use case of the library. This library doesn't mask the contents of the input. Instead it is used to format it. That is, adding spaces, dashes, or any other character of your choice, according to the format that you provide, in between the input that the user provides.

radiantshaw avatar Dec 05 '20 08:12 radiantshaw