Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

im trying to validate this form. i want to make make sure all the values were entered correctly. if they were entered incorrectly i want

im trying to validate this form. i want to make make sure all the values were entered correctly. if they were entered incorrectly i want to tell the user what is wrong with what they entered. and then i want to show the user their input after they press submit. This is my html code:

Document

and this is the javascript that i started with

this short code is not working

const form = document.getElementById("myForm");

form.addEventListener("onsubmit", ()=>{

console.log("IT is summitted!");

})

I was trying to do something like this

if (name == "") {

alert("Name must be filled out");

if you could please show me what i am doing wrong and comment on each line so i see where i went wrong. thank you!

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

More Books

Students also viewed these Databases questions

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

5. Give examples of variations in contextual rules.

Answered: 1 week ago

Question

f. What stereotypes were reinforced in the commercials?

Answered: 1 week ago