title: Send cross domain HTTP Post with HTML forms
body: <p>I have this HTML form that I need to do some processing before submitting:</p>
  
  <pre><code>&lt;form action="http://appid.appspot.com/api/foo" id="contact-form" method="post"
  name="contact-form"&gt;
      &lt;fieldset&gt;
          &lt;label&gt;&lt;input name="email" onblur=
          "if(this.value=='') this.value='Email'" onfocus=
          "if(this.value =='Email' ) this.value=''" value="Email"&gt;&lt;/label&gt;
          &lt;label&gt;&lt;input name="subject" onblur=
          "if(this.value=='') this.value='Subject'" onfocus=
          "if(this.value =='Subject' ) this.value=''" value="Subject"&gt;&lt;/label&gt; 
          &lt;textarea name="message" onblur=
          "if(this.value=='') this.value='Message'" onfocus=
          "if(this.value =='Message' ) this.value=''"&gt;
  Message
  &lt;/textarea&gt;
  
          &lt;div class="buttons"&gt;
              &lt;a href="#" onclick=
              "document.getElementById('contact-form').reset()"&gt;Clear&lt;/a&gt;
              &lt;a href="#" onclick=
              "document.getElementById('contact-form').submit()"&gt;Send&lt;/a&gt;
          &lt;/div&gt;
      &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Basically, what I need to do are:</p>
  
  <ul>
  <li><p>When the submit button is clicked, a popup window will appear to indicate that the message have been submitted (by checking the server response) anyway,</p></li>
  <li><p>I need to copy the value of a specific form input, say the value of the input element. And then prepend, say, the email to the actual message, such that the form "message" will be for example <code>"Email: x@dot.com Message: Hello world"</code> &lt;-- this will be the value of the input element with name="message" just before sending the form fields to the api</p></li>
  </ul>
  
  <p><strong>Update:</strong></p>
  
  <p>What I mean in my question is that I want to migrate this basic HTML form based POST into an Ajax call if that would be better, so I can easily achieve the goals I have outlined above.</p>