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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!