Question: Please write the following using HTML and JavaScript. The operations of a sign-up form, in which a user must input their first and last name,
Please write the following using HTML and JavaScript.
The operations of a sign-up form, in which a user must input their first and last name, phone number, birthday, user name, email address, password, and confirm their password for a new account, must be programmed. A minimum of eight characters must be used for passwords, and they must include both a letter and a number. The password must be entered twice as a validation test to ensure that the user did not unintentionally type the password incorrectly. The password box should be shown as invalid if the password does not follow the necessary pattern or if the two passwords are not the same. Steps: 1. Create a JavaScript file named 'signup.js'. Link the JavaScript and HTML files. 2. In the JS file, create an event listener for the 'click' event occurring with the 'submit' button that runs an anonymous function. 3. Within the anonymous function add the following if else structure: a. Display the validation message "Your password must be at least 8 characters with at least one letter and one number" if the pwd field does not fit the pattern. b. 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, make the validation message an empty text string. 4. Save your changes to the JavaScript file. View the HTML file in your web browser. 5. Confirm that your password must be at least eight characters long and contain both a letter and a number in order to be submitted. 6. Confirm that if the two passwords do not match, you cannot submit the form. 7. If you're able to submit the form: a. Read all input data from the HTML form. b. Display all input data under the HTML form. (Make sure to not show the password)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
