Question: I am writing this in HTML and a seperate JavaScript file but I cannot get the password match function to work. Specifically I am using

I am writing this in HTML and a seperate JavaScript file but I cannot get the password match function to work. Specifically I am using Visual Studio 2022.

I am writing this in HTML and a seperate JavaScript file but

I cannot get the password match function to work. Specifically I am

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: Steps: 1. Create a new JavaScript file. Name it assignment2.js. Connect HTML and JS files. 2. In JS file, create an event listener for the click event occurring with the submitButton that runs an anonymous function. 3. Within the anonymous function add the following if else structure: a. 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". b. Else if the value of the pwd field does not equal the value of the pwd2 display the validation message "Your passwords must match". c. Otherwise, set the validation message to an empty text string. 4. Save your changes to the JavaScript file and then open html file in your web browser. Test your work: 5. Verify that you cannot submit the form if your password is less than eight characters long and does not include at least one number and one letter. 6. Verify that you cannot submit the form if the two passwords do not match. 7. If you can submit the form: a. Read all input data from the HTML Form. b. Display all input data under the HTML Form. Note: don't show the password

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!