First: there is no need to wrap return (false);
you can simply do return false;
Second: you can setup a flag at the top of your function to false and if all elements pass your validation, set it to true.
At the end of the function, check if the flag is true and if so, call your window.open
ie. (inside your validation function)
UPDATED
function validate() {
var isValid = true;
var frm = document.forms['homevalueform'];
if (frm.EmailAddress.value == "") {
alert("Please make sure you have completed all required fields.");
frm.EmailAddress.focus();
isValid = false;
}
if (frm.LastName.value == "") {
alert("Please make sure you have completed all required fields.");
frm.LastName.focus();
isValid = false;
}
if (frm.FirstName.value == "") {
alert("Please make sure you have completed all required fields.");
frm.FirstName.focus();
isValid = false;
}
if (frm.HomeAddress.value == "") {
alert("Please make sure you have completed all required fields.");
frm.HomeAddress.focus();
isValid = false;
}
$('#HomeAddress').cleartitlelabel();
var address = $('#HomeAddress').val();
if (address == undefined){
address = '';
}
if (isValid) {
window.open('/tools/marketvalue.aspx?address=' + address);
return true;
} else {
return false;
}
}