Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I submit a form automatically (onevent) with javascript?
    primarykey
    data
    text
    <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>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload