Computers and Technology

Fill the validateForm function to check that the phone number contains a number (use the isNaN function) and that the user name is less than 11 characters long. Display "Phone number is invalid" and/or "User name is invalid" in the console log if the check does not pass. Use the preventDefault function to avoid submitting the form when the inputs are invalid. let form = document. getElementById("userForm");

function validateForm(event) {
let phoneNumber = form. phoneNumber. value;
let userName = form. userName. value;

/* Your solution goes here */

}

form. addEventListener("submit", validateForm);

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 04:30, ParallelUniverse
Which of the statements below is true? the formatting, standard, and drawing commands are unavailable. the formatting, standard, and drawing commands have been used. the formatting, standard, and drawing toolbars are displayed. the formatting, standard, and drawing toolbars are hidden.
Answers: 1
image
Computers and Technology, 23.06.2019 07:00, MissSmartyPants88
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
image
Computers and Technology, 23.06.2019 14:00, ava5015
What is html ? give a small description about html
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, MalikaJones
In the blank libreoffice writer document, to start the process of entering a date field into a letter, click on the insert menu. edit menu. file menu. fields menu.
Answers: 3
Do you know the correct answer?
Fill the validateForm function to check that the phone number contains a number (use the isNaN funct...

Questions in other subjects:

Konu
Health, 14.12.2020 23:10
Konu
Biology, 14.12.2020 23:10
Konu
Arts, 14.12.2020 23:10