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
Get step-by-step solutions from verified subject matter experts
