title: javascript onsubmit not working
body: <p>I am trying to make a javascript function work on submitting the form, the function doesnt seem to run. Can anyone help?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script&gt;
          function upload(){
                  alert("I am an alert box!");
          }
       &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form enctype="multipart/form-data" method="post" onsubmit="return upload();"&gt;
      &lt;input type="file" name="file"&gt;
      &lt;input type="submit" name="upload" value="Datei hochladen"&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>