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]
4 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]4 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
A cookie is.... a. an illegal use of information about a customer b. a feature of a Web site designed to attract children c. a f
Elodia [21]

Answer:

C. A file that a Web site stores on a visitor's computer

Explanation:

Have a nice day! :)

3 0
2 years ago
What is generation of compyter​
gavmur [86]

Answer:

the change that computers go through

Explanation:

like 6 generation

6 0
3 years ago
Read 2 more answers
If wire rope guardrails are used, what also must be done?
inn [45]
Some sort of security  pole to hold the 2 ends together firmly <span />
6 0
3 years ago
Read 2 more answers
You are preparing to give a presentation at a client’s location using your mobile device and a large screen TV. You have success
Ray Of Light [21]

Answer:

The most probable reason for this is A.

Explanation:

B should be wrong because the TV being connected to a different network segment still means that it is on the Wi-Fi network, it is just using a different switch or a repeater.

C should be wrong because the brightness of the TV does not have anything to do with being able to connect to the phone.

D should be wrong because in the question itself it says that "you tap the mirroring option on your device" which clearly means that the mobile device supports display mirroring.

The answer should be A, if the device and the TV are not on the same Wi-Fi network, than they simply can not connect and the mirroring can not be done.

I hope this answer helps.

7 0
3 years ago
How can I change my username here at brainly?
velikii [3]

Answer:

Explanation:

LOG OUT AND CHANGE IT

3 0
3 years ago
Read 2 more answers
Other questions:
  • Explain why you will not do these things when driving.<br><br>yall got one more time to delete it
    14·1 answer
  • -What does VI indicate when talking about LabView?
    8·1 answer
  • Where can I watch infinity war for free?
    9·1 answer
  • The IT Department already has been testing Windows Server 2012 R2, and some time ago purchased licenses to convert all of its Wi
    14·1 answer
  • Our Client, a renowned trading company, suffered a sudden, devastating power outage that caused their server to cease functionin
    13·1 answer
  • In which of the following situations would you want to use a word processing template?
    13·2 answers
  • Write an algorithm to show whether a given number is even or odd.
    14·1 answer
  • If anyone gotta ps4, i'm a 15 yr old female n if u wanna b frens, hmu :))
    8·2 answers
  • _____ provides the best video resolution. *<br><br> VGA<br> HDMI<br> USB<br> DVI
    7·1 answer
  • (1) Experiment Purpose
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!