Is it possible to add a cancel button in this javascript so the form will not be submitted? This Javascript is currently working in validating these form fields but if for some reason I entered a wrong information there is no way for me to cancel and prevent the form being submitted.
<form METHOD="POST" ACTION="delformaction.cfm" name="deleteform" onSubmit="return validate(deleteform);">
<script language="JavaScript">
function validate(form)
{
if (form.Institution.selectedIndex == 0)
{
alert("You must select an institution for any necessary future correspondence.");
return false;
}
if (form.Requestors_name.value == "")
{
alert("You must enter your name for any necessary future correspondence.");
return false;
}
if (form.EntityFirstName.value == "")
{
alert("You must enter the Entity's first name.");
return false;
}
alert("Your form has been successfully submitted!");
// form.reset();
return true;
}
</script>
<input type="submit" validate="submitonce" name="DeleteEntity" value="SUBMIT ONCE" class="SubmitButtons">