PHP with Javascript: Email confirmation script not working
<pre><code>  echo "&lt;script type=\"text/javascript\"&gt;
    function finishForm() {
     var answer = confirm('Are you sure these are the teams you want to enter with?');
     if (answer) {
      if(document.getElementByID(emailconfirm).value == ".$_SESSION[Email].") {
       form.action=\"esubmit.php\";
       form.submit();
      } else {
       alert('E-mail address do not match');
       return false;
      }
     } 
    }
    function restartForm() {
     var answer = confirm('Are you sure you want to start over?');
     if (answer) {
      form.action=\"e1.php\";
      form.submit();
     }
    }
     &lt;/script&gt;";  
</code></pre>

<p>I have a regular button calling this function. emailconfirm is a text input.<br>
I want to confirm that they have chosen the right teams, then check if the email in the session and the email confirmation text match. If they do match Then i want to submit the form.<br>
If they dont match, I want to alert the user they dont match, and just return to page so user can check emails and then resubmit.<br>
This script is in my header.</p>

<p>EDIT: Haha sorry i submitted one before and it didnt go through, forgot to add my problem!!</p>

<p>When you click the button it comes up with the confirmation, clicking either yes or no doesnt do anything. The alert doesnt pop up if they dont match and if they do match it doesnt submit. Also it might be good to note I had it without the email confirmation if statement and it worked fine (going to the submit page)</p>
