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
Which group scope can be used to assign permissions to resources only in the domain in which the group is created
sleet_krkn [62]

Answer: Domain local group

Explanation:

Domain Local Group is a form of group in a Windows Server network in Microsoft which is used by an administrator to assign permissions to the resources that are in same domain.

Their scope is strictly restricted to their particular domain. It should also be noted that they've open membership which simply implies that members form other domain can be added to them. One has to first know the users that have identical job responsibilities in order to use the domain local group, then identify the network resources that are similar which users want to access.

8 0
3 years ago
These devices: monitor, earphone, speakers are examples of what? Input devices Storage devices Output devices All answer are cor
solmaris [256]
They are examples of Output devices.
4 0
3 years ago
Read 2 more answers
Question 4 (2 points)
rodikova [14]

Answer:

Add the broadcast jump! code to the end of Scratch Cat's code.

Explanation:

If we broadcast the jump! code, then the Gobo will listen, and he will start jumping up and down. It looks like that he is not getting what Scratch Cat is saying, and if the message of Scratch Cat is broadcasted then Gobo will listen to what Scratch Cat is telling. Hence, the above option is the correct option.

6 0
3 years ago
Read 2 more answers
Any idea how to make my simple python projects such as guess the number, mad libs, etc. even better?
-Dominant- [34]

Answer: Person's name.

Explanation:

3 0
2 years ago
Read 2 more answers
(Exhibit: Production Possibilities Curves 2) Assume that a nation is operating on production possibilities curve CD. Economic gr
Alex

Answer:

b. shift from curve CD to curve EF.

Required Details of the Question:

The image of the curve required to answer the question has been attached.

Explanation:

A production possibilities curve shows various combinations of the amounts of two goods( in this case capital and consumer goods) which can be produced within the given resources and a graphical representation showing all the possible options of output for the two products that can be produced using all factors of production.

Now the growth of an economy is best illustrated in the image by the shift from curve CD to curve EF, this means that as the nation's production capacity increases, its production possibilities curve shift outward showing an increase in production of both goods.

3 0
3 years ago
Other questions:
  • Productivity software has been used for a number of years. Recent advancements in productivity software technology have made ___
    14·1 answer
  • A name given to a spot in memory is called:
    5·1 answer
  • Windows on the desktop are just one of many objects used in a graphical user interface (GUI)-- buttons, drop-down list boxes, po
    7·1 answer
  • A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the clie
    8·1 answer
  • In this challenge, write a function to add two floating point numbers. Determine the integer floor of the sum. The floor is the
    8·1 answer
  • In the cis configuration, the methyl groups are placed _____.
    8·2 answers
  • A style ____ is a series of rules that defines the style for a web page or an entire web site.
    6·1 answer
  • 2. The internet offers a great source of information; however, how are
    9·1 answer
  • Heeeeeeeeeeeeeeeeeeeeeeeeelp pat.2
    12·1 answer
  • How dose computers it use the information to solve problems
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!