Question
Hello. I am having some trouble with my Javascript code. I am trying to make the validate function run two other functions then if they
Hello. I am having some trouble with my Javascript code. I am trying to make the validate function run two other functions then if they both equal true to show a pop up window then submit the form. If either equals false it should not submit the form. I somehow managed to get the code to work earlier, however I started changing it around and now it has stopped working and I cant figure out how to get it to work again. The first section works, however I am having trouble with the else section.
function validate() { checkName(); checkPassword(); if (checkName() && checkPassword()) { window.alert("Submitted"); return true; } else { return false; } }
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