Question: JAVASCRIPT CODE: All work must be done in the script.js file NO CHANGES can be made to the HTML file Use the String Object methods

JAVASCRIPT CODE:

  • 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

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!