1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MaRussiya [10]
3 years ago
10

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.
Computers and Technology
1 answer:
son4ous [18]3 years ago
7 0

Answer:

Hi there! This question is asking to write a Javascript validation function to validate user input. Assuming the input fields have the id set as “phone_number” for the phone input, and “user_name” for the User’s name, we can write the function below to do the validation as required.

Explanation:

function validateForm() {

   if isNaN(document.getElementById(“phone_number”).value) {

       document.getElementById(“phone_number”).addClass(“error”)

       console.log(“Phone number is invalid”)

   }

   if document.getElementById(“user_name”).length < 11 {

       document.getElementById(“user_name”).addClass(“error”)

       console.log(“User name is invalid”)

   }

   document.getElementById(“submit”).addEventListener(“click”, function(e) {  

       if document.getElementById(“phone_number”).hasClass("error") || document.getElementById(“user_name”).hasClass(“error”)  {

           e.preventDefault();  

       }

   });

}

You might be interested in
Please answer fast computer picture above​
Bas_tet [7]

Answer:embedded computers are found in cats, appliances like light switches and voic actived tvs, security cameras, dvd players and elevators

Explanation:

5 0
2 years ago
Any Body have a zoom class goin on<br> i wanna bomb
Norma-Jean [14]

This site is only for education related questions. You should only answer or ask questions. That's what we are here for. Whoever is reading this answer, please spread it to stop people from zooming, hurting others, or just posting non-related to education questions. Thank you.

6 0
2 years ago
Kyle is running out of disk space on his hard drive on a Windows XP Professional system. He has installed and configured a third
Varvara68 [4.7K]

Answer:

The answer is "Disk utility".

Explanation:

It'll work well go over to Disk utility before updating the drivers like diskmgmt.msc throughout the Running box, or right-click Device icon, and pick Manage. Click Rescan Disks on the key decision-makers. It's not essential to reconnect until the machine recognizes the latest disc.

  • In each disc setup as storage properties is a reactive drive. Almost every dynamic disk is separated into quantities.
  • It is the season, spanned, and strip volume forms will be included.
5 0
2 years ago
Read 2 more answers
PLEASE CAN ANYBODY ANSWER ANY OF THESE
Pie

16 in Binary is ob10000

32 in Binary ob100000

I'm not sure if those are in 8 bit or not.


6 0
3 years ago
Next, Sue decides to embed a chart from Microsoft Word. She copies and pastes data from a table that she has already created in
antoniya [11.8K]

Answer:

Its D

Explanation:

On Edg

8 0
3 years ago
Other questions:
  • Why is it a mistake to put e-mail address of people who don't know each other in the "to:" field
    9·2 answers
  • The ability to learn a new computer software program is to ____________ as knowledge of state capitals is to _____________.
    11·1 answer
  • In the MOV instruction both operands i.e. source andthe destination cannot be
    15·2 answers
  • Select the statement that accurately describes why the Italics function is being used in the sentences below.
    8·1 answer
  • Suppose that you want to write a program that inputs customer data and displays a summary of the number of customers who owe mor
    14·1 answer
  • A third-grade teacher at Potter Elementary School wants a program that allows a student to enter the amount of money a customer
    14·1 answer
  • Write a program that displays the following menu:
    8·1 answer
  • Which rule should be followed to stay safe online
    5·1 answer
  • Plymouth Colony was originally founded by a group of people called Pilgrims. Since Plymouth did not have an official charter fro
    15·1 answer
  • GuardIN is an IT security firm. It deals with highly secure data for a wide variety of software and e-commerce agreements, trade
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!