change: function sendTestEmail(){ f=document.emailForm; f.validate(); f.to.value=prompt('Please supply a "To:" for the test E-mail'); if (f.to.value==''){ return false; } f.action='sendEmail.php'; f.submit(); } function validate(){ f=document.emailForm; if (f.emaillabel.value == "") { f.emaillabel.focus(); alert("Choose an E-mail label."); return false; } if (f.body.value == "") { f.body.focus(); alert("Please add a Subject."); return false; } } to: function sendTestEmail(){ f=document.emailForm; if(validate(f)) return false; f.to.value=prompt('Please supply a "To:" for the test E-mail'); if (f.to.value==''){ return false; } f.action='sendEmail.php'; f.submit(); } function validate(f){ if (f.emaillabel.value == "") { f.emaillabel.focus(); alert("Choose an E-mail label."); return false; } if (f.body.value == "") { f.body.focus(); alert("Please add a Subject."); return false; } return true; }