I have the following but the validation isn't working any ideas? I basically want it to validate the email and then validate the confirm email address. The confirm email address should match the email address input. Thanks.
Code:function checkData() {
warn = "";
df = document.buytickets;
errorLayer = document.getElementById("error");
if(df.emailAddress.value != "") {
warn += "Email Address\n";
}
if(email == confirmEmail) {
warn += "Confirm Email Address\n";
}
if(warn == "") { return true; }
else {
warn = "Please correct the following:\n\n" + warn;
errorLayer.innerHTML = warn;
return false;
}
}
HTML Code:<form name="buytickets" id="buytickets" onsubmit="return checkData()">
<input type="text" id="emailAddress" />
<input type="text" id="confirmEmailAddress"/>
</form>
<div id="error"></div>
