title: Can't pass a javascript function / variable from one case to another
body: <p>I'm trying to have the parent window open a child window in one case, and then have that window closed in a different case in the parent window:</p>
  
  <pre><code>case "case1": ?&gt;
      &lt;script language="JavaScript" type="text/javascript" src="javascripts.js&gt;&lt;/script&gt;
      &lt;script&gt;openWin();&lt;/script&gt;
      &lt;?php
          $nextDecision ="
                  &lt;form action=\"index.php\" method=\"get\"&gt;
                  &lt;input type=\"radio\" name=\"choice\" value=\"val1\"&gt;message&lt;br&gt;
                  &lt;input type=\"submit\"&gt;
                  &lt;/form&gt;";  
                  ?&gt;
      break;
  case "case2": 
      $nextDecision = "
                  &lt;form action=\"index.php\" method=\"get\"&gt;
                  &lt;input type=\"radio\" id=\"choice\" name=\"choice\" onsubmit=\"closeWin()\" value=\"val2\"&gt;message&lt;br&gt;
                  &lt;input type=\"submit\"&gt;
                  &lt;/form&gt;";
      break;
  </code></pre>
  
  <p>javascripts.js:</p>
  
  <pre><code>var myWindowwin;
  
  function openWin() {
      myWindowwin = window.open("path/file.html","name","width=547,height=480");
  }
  
  function closeWin() {
      document.getElementById('choice').value = 'val2';
      myWindowwin.close();
  }
  </code></pre>
  
  <p>The child window will open, but not close.</p>