Question
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:
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started