Here is your complete function with the addition of return false.
In addition, when you call valSubmit, it should look like this:
... onsubmit = "return valSubmit ();" ...
Note that you also need to specify return.
Here is the function:
function valSubmit(){
varName = document.form1.txtName.value;
varSurname = document.form1.txtSurname.value;
varEmail = document.form1.txtEmail.value;
varOrg = document.form1.txtOrg.value;
if (varName == "" || varSurname == "" || varEmail == "" || varOrg == "" )
{
alert("Please fill in all mandatory fields");
return false;
}
else
{
document.body.style.cursor = 'wait';
document.form1.btnSubmit.style.cursor = 'wait';
document.form1.action = "http://now.eloqua.com/e/f2.aspx"
document.form1.submit();
return true;
}
}
source
share