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.

Lesson 7 Application Project

CIW JavaScript Specialist


Visa

MasterCard

American Express

Card #

Exp Date:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!