All pastes #16010 Raw Edit

Stuff

public text v1 · immutable
#16010 ·published 2005-06-27 20:28 UTC
rendered paste body
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;
                }