Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

General information (10 points) All work must be done in the script.js file NO CHANGES can be made to the HTML file Use the String

General information (10 points)

  • All work must be done in the script.js file
  • NO CHANGES can be made to the HTML file
  • Use the String Object methods for input validation
  • A message must be added to the console when a field does not meet the criteria

ValidateForm() (60 points)

Criteria

First Name:

Last Name:

  • Only letters
  • First letter is upper case
  • Min 1 letter
  • Max 16 chars
  • Allow - (dash) character

Password:

  • Letters and Numbers
  • Allow !, ?, .
  • Min 1 capital letter
  • Min 8 chars
  • Max 16 chars
  • Does not contain first name
  • Does not contain last name
  • Min 2 numbers

Username:

  • Letters and Numbers
  • Min 6 chars
  • Max 16 chars
  • Allow _, .

Email:

  • All emails must respect the following format: username@domain.ext
  • The username section must comply with the following restrictions:
    • Letters and Numbers
    • Allow _, . or -
    • Must start with an alphanumeric character
    • Min 1 char
    • Max 16 chars
  • Must be followed by the @ character
  • The domain section must comply with the following restrictions:
    • Letters and Numbers
    • Allow .
    • Min 2 char
    • Max 24 chars
    • Must start with a letter
    • Must end with a letter
  • The extension must be 1 of the following:
    • .com
    • .ca
    • .qc.ca

If all criteria are met, the form needs to be submitted

getName() (30 points)

Display the value of all entered form information on the console (a different log() for each information):

  1. First Name
  2. Last Name
  3. Username
  4. Password
  5. EMail
  6. Gender
  7. Pets (together)
  8. Comments
  9. Age

HTML CODE:

Forms

//JS CODE:

function getName(){

}

function validateForm(){

}

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

Database Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions