subject

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);

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:00
Analyze the following code. int x = 1; while (0 < x) & & (x < 100) system.out.println(x++); a. the loop runs forever. b. the code does not compile because the loop body is not in the braces. c. the code does not compile because (0 < x) & & (x < 100) is not enclosed in a pair of parentheses. d. the numbers 1 to 99 are displayed. e. the numbers 2 to 100 are displayed.
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. which step can possibly increase the severity of an incident? a. separating sensitive data from non-sensitive data b. immediately spreading the news about the incident response plan c. installing new hard disks d. increasing access controls
Answers: 2
question
Computers and Technology, 24.06.2019 00:40
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
The length of time that a slide appears before automatically advancing to the next slide can be set in the timing group under the transitions tab. transition to this slide group under the transitions tab. timing group in the master slide view. transition to this slide group in the master slide view.
Answers: 1
You know the right answer?
Fill the validateForm function to check that the phone number contains a number (use the isNaN funct...
Questions
question
History, 08.01.2021 20:40
question
Computers and Technology, 08.01.2021 20:40
question
Mathematics, 08.01.2021 20:40
Questions on the website: 13722363