Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8.18 LAB: User registration and validation with regex In this lab, you will use regular expressions with JavaScript to validate a user registration form. Error

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

8.18 LAB: User registration and validation with regex In this lab, you will use regular expressions with JavaScript to validate a user registration form. Error messages will be displayed at the bottom of the form, as shown below. User Registration Full Name Email Password Confirm Password - Password must be between 10 and 20 characters. - Password must contain at least one uppercase character. - Password must contain at least one digit. Complete checkForm() in register.js to verify that the user-provided information is valid. - If form validation errors exist: - Display the formErrors by removing the hide class - Display each of the associated error messages in the formErrors using an unordered list. The error message must be displayed in the order the validation is performed, following the order specified below. - Add the error class to each element with invalid input - If no form validation errors exist: - Hide the formErrors by adding the hide class - Remove the error class from all test, email, and password elements - Perform the following form validations in the order provided and display all error messages that apply: - Ensure a full name with a length greater than or equal to 1 was provided - Otherwise, display "Missing full name." - Ensure that an email address was provided and that the email address matches the regular expression: /[azAz09._]+@[azAz09.]+\[azAz]{2,5}$/ - Otherwise, display "Invalid or missing email address." - Ensure the password has 10 to 20 characters - Otherwise, display "Password must be between 10 and 20 characters." - Ensure the password contains at least one lowercase character (use a regular expression) - Otherwise, display "Password must contain at least one lowercase character." - Ensure the password contains at least one uppercase character (use a regular expression) - Otherwise, display "Password must contain at least one uppercase character." - Ensure the password contains at least one digit (use a regular expression) - Otherwise, display "Password must contain at least one digit." - Ensure the password and confirmation password match - Otherwise, display "Password and confirmation password don't match." Test your solution by typing invalid data in each input and pressing the Register button. Verify a red border surrounds the input with invalid data and the correct error message displays. 2:Unit test 0/2 Testing validation: formErrors div with no input Number of tags (error messages) Error message in tag \#1 Error message in tag \#2 Error message in tag \#3 Error message in tag \#4 Error message in tag #5 Error message in tag \#6 Full Name input has "error" class. Your value Expected value Test aborted. 3:Unit test 0/1 Test validation message: Invalid email only Number of tags (error messages) is 1 Error message in tag \#1 Email input has "error" class. Your value Expected value 4:Unit test 0/1 Test validation message: Short password Number of tags (error messages) is 1 Error message in tag \#1 Password input has "error" class. 5:Unit test Test validation message: Long password Number of tags (error messages) is 1 Error message in tag \#1 Password input has "error" class. Your value Expected value 6:Unit test c Test validation message: Password and confirm password do not match Number of tags (error messages) is 1 Email message in tag #1 Confirm password input has "error" class. Your value Expected value 7:Unit test Test validation message: No lowercase or digit Number of tags (error messages) is 2 Error message in tag \#1 Error message in tag \#2 Password input has "error" class. Your value Expected value 8:Unit test Test password confirmation: Invalid then valid formsError does not have "hide" class when emtpy form is submitted Initial number of tags (error messages) is 1 after invalid password confirmation formsError has "hide" class after supplying valid data Your value Expected value Test aborted. 9:QUnit test Test name and email: Invalid then valid formsError does not have "hide" class when emtpy form is submitted Initial number of tags (error messages) is 2 after invalid password confirmation formsError has "hide" class after supplying valid data Your value Expected value Test aborted.Not the question youre looking for?Post any question and get expert help quickly.Start learning Chegg Products & ServicesChegg Study HelpCitation GeneratorDigital Access CodesGrammar CheckerMath SolverMobile AppsSolutions ManualPlagiarism CheckerChegg PerksCompanyCompanyAbout CheggChegg For GoodCollege MarketingInvestor RelationsJobsJoin Our Affiliate ProgramMedia CenterSite MapChegg NetworkChegg NetworkBusuuCitation MachineEasyBibMathwayThinkfulCustomer ServiceCustomer ServiceGive Us FeedbackCustomer ServiceManage SubscriptionEducatorsEducatorsAcademic IntegrityHonor ShieldInstitute of Digital Learning 2003-2024 Chegg Inc. All rights reserved.Cookie NoticeYour Privacy ChoicesDo Not Sell My InfoGeneral PoliciesPrivacy Policy (New)Honor CodeIP Rights

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions