Question: Create JavaScript to validate the form The form accepts some personal information, item quanitites, and a shipping method. Your task is to ensure that the

Create JavaScript to validate the form

The form accepts some personal information, item quanitites, and a shipping method. Your task is to ensure that the user inputs the correct data. In particular:

The firstName, lastName, address, city, province, and postalCode fields must all have a value.

The postalCode field must be 6 digits long

The quantity fields for the widgits must contain a number greater than or equal to zero

At least one item must be ordered

The user must be notified of the errors in the form. I am going to allow for some creativity on your part on how this is to be done. The only requirement is that it is clear to the user which fields have errors, and what the errors are.

Finally, if the form submission is valid, display an alert to the user confirming the successful submission of their form, and inform them of the total price. If there are errors in the form, it should not submit.

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!