subject
Computers and Technology, 25.02.2020 21:59 JaredO

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.
html code:

Username:

JAVA:

var form = document. getElementById("userForm");

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

/* Your solution goes here */

}

form. addEventListener("submit", validateForm);

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:30
Jasper and samantha are in a robotics competition. the guidelines state that the robots should be able to move a 10-gram weight at least 2 meters and turn in a circle. jasper and samantha have already built the robot. which step of the design process should they follow next to decide whether their robot meets the minimum criteria for the competition?
Answers: 1
question
Computers and Technology, 22.06.2019 09:00
Which best describes the condition under which the unicode output is the same as plain text?
Answers: 3
question
Computers and Technology, 23.06.2019 03:00
What are the different parts of computer
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Jace needs to answer a question on square roots to win a quiz. how can he use a spreadsheet to find the square root of 786? a. use the functions round and count b. create a table and chart c. use the function sqrt d. use the function now
Answers: 3
You know the right answer?
Fill the validateForm function to check that the phone number contains a number (use the isNaN funct...
Questions
question
Mathematics, 15.10.2020 04:01
question
Mathematics, 15.10.2020 04:01
question
Mathematics, 15.10.2020 04:01
question
Mathematics, 15.10.2020 04:01
question
Social Studies, 15.10.2020 04:01
question
Mathematics, 15.10.2020 04:01
Questions on the website: 13722362