Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Go to the project 0 2 - 0 2 . js file in your code editor. Create a function named verifyForm ( ) with no

Go to the project02-02.js file in your code editor. Create a function named verifyForm() with no parameters. Within the function do the following:
Declare the name variable equal to the value of the input control with the id name.
Declare the email variable equal to the value of the input control with the id email.
Declare the phone variable equal to the value of the input control with the id phone.
Insert a conditional operator that tests the truthy or falsy value of and name and email and phone using the && operator. If the result of this conditional expression is true, use the window.alert() method to display the message Thank you!, otherwise display the message Please fill in all fields.
Below the verifyForm() function insert a statement that attaches an event listener to the page element with the id submit. When the click event occurs for this element, run the verifyForm() function.
Save your changes to the file and then open project02-02.html in your web browser.
Test the web form by clicking the Submit button with one or all the fields left blank, verifying that an alert box with the message Please fill in all fields is displayed. Enter text in all the fields and click the Submit button, verifying that an alert box with the message Thank you! is displayed.

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago