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
Halcyon, an e-publisher, has recently decided to use an information system that administers the way its customers access its onl
puteri [66]

Answer:

b) digital rights management

Explanation:

Halcyon, an e-publisher, has recently decided to use an information system that administers the way its customers access its online publications. The system assigns each customer with a unique ID, maintains records of the books purchased by them, encrypts electronic documents for transmission, and includes options to order hard copies of the electronic documents they read online. The set of technology being used here is digital rights management.

8 0
3 years ago
What is one reason you might want to change your document's margins
Masteriza [31]

Answer:

1. If there is a big table or picture needed to show in a single paper.

2. For showing differences between two things.

3. To have more words to fit in a paper

Explanation:

6 0
3 years ago
PORFA AYUDAAAA DOY CORONA (solo si puedo) ES DE TECNOLOGÍA
Jlenok [28]

Answer:

de una socieda

Explanation:

8 0
3 years ago
Which of the following is not a concern that has come out of the widespread adoption of the Internet?
slamgirl [31]

Answer:

The correct option is;

Selecting the correct browser to use for the sites you want to visit

Explanation:

Censorship of information is the subduing of information based on the consideration of such information being harmful or inconvenient

Increased anonymity

Making an individual anonymous which is one of the capabilities of the internet, is seen as encouraging unethical behavior and promoting discussions which are deemed uncivil in a commonly shared space online.

Unauthorized sharing of copyrighted information

The sharing and distribution of copyrighted material is against the law but it is a common occurrence and in various formats online

Out of the given options, selecting the correct browser to use for the sites you want to visit is the one that is not a concern.

5 0
3 years ago
Help please I would really appreciate <br>​
Dafna1 [17]

Answer:

the answer is address bar

3 0
4 years ago
Read 2 more answers
Other questions:
  • Pages with obvious problem with functionality or errors in displaying content
    11·1 answer
  • Which is better to use for cleaning electronics, Ethyl alcohol vs isopropyl alcohol?
    14·1 answer
  • What is requirement analysis
    8·1 answer
  • Two electronics technicians are discussing electrical quantities. Technician A says that resistance is an opposition to electric
    6·1 answer
  • What is the term for an e-mail server program that receives sent messages and delivers them to their proper destination?
    14·1 answer
  • If a suspect is not read his or her Miranda rights, then nothing the suspect says can be used at trial, even if the suspect volu
    11·1 answer
  • Alice is adding a chart in a spreadsheet. Which option will allow you her to give the chart a suitable title and subtitle?
    11·2 answers
  • ​Microsoft claims that the microsoft project software can _____.
    11·1 answer
  • You have a notebook computer and wish to connect to an IEEE 802.11ac wireless network. The computer does not have a built-in WLA
    15·1 answer
  • Fast i need now ill give anything
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!