answer.
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
vampirchik [111]
2 years ago
9

g Fill the validateForm function to check that the phone number is 10 characters long and that the user name is less than 11 cha

racters 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:
Rom4ik [11]2 years ago
8 0

Answer:

function validateForm(event)

{

event.preventDefault();

var phoneNumber = form.phoneNumber.value;

var userName = form.userName.value;

if(phoneNumber.length!=10)

console.log("Phone Number is Invalid");

if(userName.length<11)

console.log("User Name is Invalid"); }

You might be interested in
Define and test a function myRange. This function should behave like Python’s standard range function, with the required and opt
Cerrena [4.2K]

Answer:

Study Python’s help on range to determine the names, positions, and what to do with your function’s parameters.

Use a default value of None for the two optional parameters. If these parameters both equal None, then the function has been called with just the stop value. If just the third parameter equals None, then the function has been called with a start value as well. Thus, the first part of the function’s code establishes what the values of the parameters are or should be. The rest of the code uses those values to build a list by counting up or down.

6 0
1 year ago
Read 2 more answers
g Fill the validateForm function to check that the phone number is 10 characters long and that the user name is less than 11 cha
Rom4ik [11]

Answer:

function validateForm(event)

{

event.preventDefault();

var phoneNumber = form.phoneNumber.value;

var userName = form.userName.value;

if(phoneNumber.length!=10)

console.log("Phone Number is Invalid");

if(userName.length<11)

console.log("User Name is Invalid"); }

8 0
2 years ago
You are responsible for a rail convoy of goods consisting of several boxcars. You start the train and after a few minutes you re
maks197457 [2]

Answer:

The program in C++ is as follows:

#include <iostream>

#include <iomanip>

using namespace std;

int main(){

   int cars;

   cin>>cars;

   double weights[cars];

   double total = 0;

   for(int i = 0; i<cars;i++){

       cin>>weights[i];

       total+=weights[i];    }

   double avg = total/cars;

   for(int i = 0; i<cars;i++){

       cout<<fixed<<setprecision(1)<<avg-weights[i]<<endl;    }

   return 0;

}

Explanation:

This declares the number of cars as integers

   int cars;

This gets input for the number of cars

   cin>>cars;

This declares the weight of the cars as an array of double datatype

   double weights[cars];

This initializes the total weights to 0

   double total = 0;

This iterates through the number of cars

   for(int i = 0; i<cars;i++){

This gets input for each weight

       cin>>weights[i];

This adds up the total weight

       total+=weights[i];    }

This calculates the average weights

   double avg = total/cars;

This iterates through the number of cars

   for(int i = 0; i<cars;i++){

This prints how much weight to be added or subtracted

       cout<<fixed<<setprecision(1)<<avg-weights[i]<<endl;    }

4 0
1 year ago
What does Josh Silverman name as the most important aspect of managing finances?
Andre45 [30]

The answer is a the first one

6 0
1 year ago
Read 2 more answers
Which native windows application allows one to access basic pc settings and controls system info?
vlabodo [156]
As far as windows 7 and below it was control panel, but in windows 8 and higher, microsoft added, a new app which was called settings, control panel was still there but with a few features removed
7 0
2 years ago
Read 2 more answers
Other questions:
  • When seeking information on the internet about a variety of subjects the most useful place to look would be?
    13·2 answers
  • Propane also known as LP gas, is often mixed with about _______ percent of other gases, such as butane, propylene, and mercaptan
    13·1 answer
  • Java languageThe cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.1. Declare a constant named CENTS_PER_
    5·2 answers
  • Which word in brackets is most opposite to the word in capitals? PROSCRIBE (allow, stifle, promote, verify)​
    14·2 answers
  • A common fallacy is to use MIPS (millions of instructions per second) to compare the performance of two different processors, an
    15·1 answer
  • This exercise shows why each pivot (in eli1nination by pivoting) must be in a different row. (a) In Example 7, make the third pi
    15·1 answer
  • Write the definition of a function named averager that receives a double parameter and return-- as a double -- the average value
    12·1 answer
  • Early Intel processors (e.g., the 8086) did not provide hardware support for dual-mode operation (i.e., support for a separate u
    12·1 answer
  • If the object instance is created in a user program, then the object instance can access both the public and private members of
    9·1 answer
  • Members of the sales team use laptops to connect to the company network. While traveling, they connect their laptops to the inte
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!