title: Javascript globals variables unchangeable in onsubmit event handler
body: <p>I've attached onsubmit handler in a form tag like this:</p>
  
  <pre><code>&lt;form action="file.php" method="post" onsubmit=" return get_prepared_build(this);" &gt;
  </code></pre>
  
  <p>but whatever global variable (defined earlier, of course) I try to change inside get_prepared_build() function - later it apprears non-modified. Looks like that this function
  deals with a local copy of everything, even document property values are not saved.</p>
  
  <p>Are there scope/visibility problems when javascript functions are called this way from tags/attributes?</p>
  
  <p>Here is the function:</p>
  
  <pre><code>function give_link(results)
  {
      document.title = 'visibility test';
      return false;
  }
  </code></pre>
  
  <p>then below in the document I have</p>
  
  <pre><code>&lt;script&gt;alert('test' + document.title );&lt;/script&gt;
  </code></pre>
  
  <p>As a result - in the window I have a new title, but the alert box displays old variable value.</p>