Question: Add script to this program so that when a button is clicked, a script will perform validation tests. 1. Test the experation date for validity
Add script to this program so that when a button is clicked, a script will perform validation tests.
1. Test the experation date for validity (i.e. expires after current date).
2. Test the digits entered in the card number field to see whether they are valid for the type of credit card selected.
* Visa card numbers always begin with the number 4 and use 16 digits.
* Mastercard numbers always begin with 5 and use 16 digits
*American Express card numbers always begin with the number 3 and use 15 digits.
3. If the card numbers are inccorrect based on the card type selected, ask the user to either select a different credit card type or change the card number. If the number of digits corresponds correctly, acknowledge that.
CIW JavaScript Specialist
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
