Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Form validation is an important component of website development. There are a couple of ways that we can accomplish form validation in an html page:

  1. Form validation is an important component of website development. There are a couple of ways that we can accomplish form validation in an html page:
    1. JavaScript traditional method - create a function that is called on submission of the form, validate each individual element in the form sequentially (using regular expressions where needed).

Figure 1. Part 1 form display form validation using regular expressions

You must use JavaScript to validate the form according to the following criteria:

  • Name field cannot be blank
  • Age field must be a number between 0 and 120
  • Email field must be a valid email determined through regular expressions.
  • Phone field must be in the format of 000-000-0000 or 0000000000 or 000 000 0000
  • Postal code field must be in the format of a Canadian postal code (ANANAN or ANA NAN) where A is an alphabetic character and N is a number, for example V8X 1H8.

Each field that is being validated must have a meaningful message that indicates there is an error for that field. Once the form has been successfully validated, your page should display an alert message indicating that the validation was successful.

NOTE: make sure that you follow proper practices, one of which is making sure that the user does not need to retype in any good data. In other words, if you have two fields containing valid data that data should remain in the input box while other fields are validated.

image text in transcribed

Part 1 Question 1 Name: Age Email: Phone # phone number Postal Code postal code Submit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago