title: How can I submit a form automatically (onevent) with javascript?
body: <p>I'd like to be able to submit a form automatically on an event ( a generic form, for user tracking).</p>
  
  <p>For example, create a POST to 
      <a href="http://www.example.com/index.php?option=track&amp;variable=variable" rel="nofollow">http://www.example.com/index.php?option=track&amp;variable=variable</a>
      application/x-www-form-urlencoded with stuff like</p>
  
  <pre><code>username=usernamestring
  otherdata=otherdata_string
  otherdata2=otherdata string 2
  </code></pre>
  
  <p>The actual string will be preformatted, though, because all it is is like a 'ping'. 
  It needs to be submitted onevent, with external js ( <a href="http://example.com/scripts/js.js" rel="nofollow">http://example.com/scripts/js.js</a> )</p>
  
  <p>What the hay should I do? This is getting annoying.</p>
  
  <p>Update: I guess I didn't really make myself clear; I have a premade form that isn't supposed to display on the page; it needs to submit on an event. The form fields do not exist on the page; all I do is link to the script on the page and it executes onLoad.</p>
  
  <p>POST uri: <a href="http://www.example.com/index.php?option=track&amp;variable=variable" rel="nofollow">http://www.example.com/index.php?option=track&amp;variable=variable</a>
  The arguments above (option=track and variable=variable) are not the form details (postdata).</p>
  
  <p>The content type is application/x-www-form-urlencoded , and has the following keys/values.</p>
  
  <pre><code>username=usernamestring
  otherdata=otherdata_string
  otherdata2=otherdata string 2 (when encoded, the spaces get turned to %20's.)
  </code></pre>
  
  <p>I need a script that submits this when run.</p>