Create Custom Credit Card Mask

Asked

Viewed 1,000 times

0

Good afternoon to all.

I need to create a mask for a text field to mask credit card in the following format:

Without mask: 4854 5654 2245 5654
Masked: 4854 xxxx xxxx 5654

Does anyone know how I can do this in the text field?

  • I don’t know if it’s a good idea to do this on the client side (javascript). It would be better to already take to the client side the string formatted without the full number (with mask) for security reasons.

  • @Marcogiovanni, the problem is that it is a login form. The credit card is the login of the user, that is, it type the card. I need to mask how much he types.

  • 1

    I always use this plugin http://digitalbush.com/projects/masked-input-plugin/ suits me well.

  • this plugin can not do what I need, unfortunately. it even creates the mask, but does not hide the middle numbers...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.