title: HTML Form Redirect After Submit
body: <p>This is my form code:</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" name="upload-file" method="post"  action="http://example.com/upload"&gt;
      &lt;div class="formi"&gt;
          &lt;input id="text-link-input" type="text" name="url" class="link_form" value="your link"  onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;"   /&gt;
          &lt;input type="submit" value="OK" class="link_but" /&gt;
      &lt;/div&gt;
      &lt;div class="upl" title="Upload"&gt;&lt;img src="http://example.com/example.png" alt="" style="vertical-align:middle;"/&gt;Upload
          &lt;input type="file" name="file" size="1" class="up" onchange = "document.getElementById('text-link-input').value = String(this.value).replace('C:\\fakepath\\','')"/&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Now, I want to redirect the submitter to any page of my choice after the form data has been submitted, but the action resides on another website where I cannot edit. Is it possible to redirect the user to any page after he has submitted the data to that site?</p>
  
  <p>From some Googling, this is what I have found. Adding this to form code:</p>
  
  <pre><code>onSubmit=window.location='http://google.com'
  </code></pre>
  
  <p>This didnt work. Maybe I didnt implement it correctly? This is what I did:</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" name="upload-file" method="post" onSubmit=window.location='http://google.com' action="http://example.com/upload"&gt;
  </code></pre>
  
  <p>Another person says adding a hidden field should work:</p>
  
  <pre><code>&lt;input type="hidden" name="redirect" value="http://your.host/to/file.html"&gt; 
  </code></pre>
  
  <p>How should I implement this is my code?</p>
  
  <p>Suggestions and help awaited...</p>