title: javascript form submission to modify action
body: <p>I'm trying to modify the post url of a form depending on the name of the file being posted. Any suggestions very much appreciated. Here is the code (which doesn't work):</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;  
      function submit_form()  
      {
          document.uploadform.action = "upload?name=" + document.uploadform.codejar.value;
          return 1;
      }
  &lt;/script&gt;
  &lt;form name="uploadform" method="post" onsubmit="return submit_form();"&gt; 
  &lt;table&gt; 
  &lt;tr&gt;&lt;td&gt;Select your jar to upload&lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;td&gt; &lt;input type="file" name="codejar" style="width: 400"&gt;&lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;td&gt;&lt;input type="submit" name="send" value="Upload jar"&gt;&lt;/td&gt;&lt;/tr&gt; 
  &lt;/table&gt; 
  &lt;/form&gt; 
  </code></pre>