I have this html form that has two inputs. I have onsubmit="formValidate()" which should run that function when the user hits submit. I the function is checking if the two inputs have stuff in them or if they're empty. If they're empty it'll change
to say something like "Not complete" if the inputs are empty or "Complete" if they're filled out. I can't get this to work. function formValidate(){
var form = document.forms["Form"]
["name"].value;
if (name == "", email == "") {
output = "Not Complete";
}
else{
output = "Complete";
}
document.getElementById("test").innerHTML = output;
}
<form name="Form" onsubmit="formValidate()">
<label>Name:</label>
<input type="text" id="name" name="name"><br/>
<label>Email:</label>
<input type="text" id="email" name="email"><br/>
<button type="submit">Submit</button>
<p id="test"></p>
</form>