title: Problem using window.location in a function called from onsubmit
body: <p>I'm currently creating a very small form on my homepage using HTML and JavaScript. I've run into a problem I'm pretty sure I could circumvent somehow (probably in a pretty ugly way though), but I got interested in why this error appears.</p>
  
  <p>I have a form on my page which I specify in the following way:</p>
  
  <pre><code>&lt;FORM name="form1" onsubmit="submitTheScript()"&gt;
  </code></pre>
  
  <p>The function "submitTheScript()" is placed in the header and reads:</p>
  
  <pre><code>setCookie("F_GivenSum", GivenSum);
  window.location="LastScreen.html";
  </code></pre>
  
  <p>"setCookie()" is a function that basically just, well, creates a cookie :).</p>
  
  <p>Now, the problem arises with the last line of code. I'm trying to send the user to another page, after the cookie has been set (I'm doing some controls that the input value is alright, but I've skipped that part here) but FireFox gives me the following error:</p>
  
  <pre><code>uncaught exception: [Exception... "Cannot modify properties of a WrappedNative"  nsresult: "0x80570034 (NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN)"  location: "JS frame :: chrome://global/content/bindings/autocomplete.xml :: onxblpopuphiding :: line 827"  data: no]
  </code></pre>
  
  <p>I guess I can't call this function the way I do, from within a onsubmit command, however, I don't see why.</p>