Reputation: 369
I am currently working on a web application using ASP.Net (C#) for assigning cards.
A user can swipe a card using a magnetic swipe card reader to fill in a text box, and depending on the card existing in the application database, attach a card to a customer profile.
The same process can be completed if a user manually enters the card number into the text box without assistance.
To prevent user error, I am looking into adding a validation number for each card.
My problem concerns differentiating between manual input versus a card reader. Obviously a user is not going to want to enter a validation code manually if they have swiped, whereas manual input should always be checked with the validation code.
I have tested using a timer when a user is focused on the card number text box to determine which input method has been used, but before I go ahead with this implementation I want to check for any better alternatives.
As a final note, the user could be repeating this process many times.
Upvotes: 0
Views: 143
Reputation: 851
Did you write the code that reads the card? If so...
You could edit that code to also set a hidden check box on the page that indicates if a validation code is required. This being the case the validation code box becomes available to the user to enter said code. This way you check that a code is required and that a code has been provided before submission.
Upvotes: 1