Question
In this project you will program the actions of a sign-up form in which users must supply : first name, last name, telephone number, birthday
In this project you will program the actions of a sign-up form in which users must supply: first name, last name, telephone number, birthday date, a user name, email address, password, and re-enter the password for a new account.
Passwords must be at least eight characters long and contain at least one letter and one number. As a validation test, the password must be entered twice to confirm that the user did not inadvertently mistype the password. If the password does not match the required pattern or if the two passwords are not identical, the password field should be flagged as invalid.
A preview of the form in which the passwords are mismatched is shown:
Create a new JavaScript file. Name it assignment2.js. Connect HTML and JS files.
In JS file, create an event listener for the click event occurring with the submitButton that runs an anonymous function.
Within the anonymous function add the following if else structure:
If the pwd field fails the pattern match, display the validation message Your password must be at least 8 characters with at least one letter and one number.
Else if the value of the pwd field does not equal the value of the pwd2 display the validation message Your passwords must match.
Otherwise, set the validation message to an empty text string.
Save your changes to the JavaScript file and then open html file in your web browser.
Password Confirm Fassword 1. Your puswends mast mutch
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started