Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7.7 Form Validation Needing help to figure out what I am doing wrong! Question: Fill the validateForm function to check that the phone number contains

7.7 Form Validation

Needing help to figure out what I am doing wrong!

Question: image text in transcribed

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. HTML JavaScript function validateForm(event) { let phoneNumber = form.phoneNumber.value; let userName = form.userName.value; 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 /* Your solution goes here */ if(!isNaN(phoneNumber)) { if(userName.length

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

Why is identifying a target market so important to a company?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago