|
Hi
I want to create an input field in jsp page such that it displays * for the first 10 characters and display the typed characters for the next 4 characters.But the typed 14 characters must be stored for further processing.i want to use it in credit card program
|
|
|
My advice is to stick to the standard -- have a regular text element where the user enters the credit card number. When they submit the form, you'll have the full credit card number. From then on, whenever you display the card # back to the user or send it to them on printed documents, use a mask to hide all but the last four digits.
In ecommerce systems I've built before, I NEVER even stored the full number. I used the full number to authorize the card, but I only stored the first and last four digits in my database. This way there was no way somebody could hack my database to steal credit card numbers. I was 100% sure because I did not have the numbers in my database. Your needs may be different.
You are thinking that you want to protect the user when entering their card number from people who may be standing around--right? Hiding the card number during entry will make it very difficult for many people to enter their number because they don't have it memorized. That works for passwords because most people can type their password without looking. If a user feels it is not safe to momentarily enter their card number on a web page, then they probably don't feel safe to even pull their card out to look at the number so they can enter it in the first place.
There are tricks you could do to try to simulate the effect you asked for, but you'd probably end up with something that does not work in all browsers, and would still not work exactly as desired. I played with this for an hour and came up with something close--but not good enough for production use.
|
|
|
|
|
|
|
|
|
|