Note that there are some explanatory texts on larger screens.

plurals
  1. POPass data to a FORM and auto submit it
    primarykey
    data
    text
    <p>The thing I'm trying to have is a JQuery/JavaScript code that will automatically pass some data from facebook to a form (basically the form doesn't need to be shown). so the first part is ready (the part that pulls the data from facebook).</p> <pre><code> window.fbAsyncInit = function() { FB.init({appId: 'xxxxxxxxxxxxxxx', status: true, cookie: true, xfbml: true}); }; FB.Event.subscribe('auth.login', function(response) { if (response.session) { FB.api({ method: "fql.query", query: "SELECT name,email FROM user WHERE uid = " + response.session.uid } </code></pre> <p>Now i need to insert the name and the email to the inputs with name="name" and name="email" and auto submit the form.</p> <p>Thanks in advance!</p> <p>EDIT: here is the form:</p> <pre><code>&lt;form method="post" class="af-form-wrapper" action="http://www.aweber.com/scripts/addlead.pl" &gt; &lt;input type="hidden" name="meta_web_form_id" value="XXXXXXXX" /&gt; &lt;input type="hidden" name="listname" value="XXXXXX" /&gt; &lt;input type="hidden" name="meta_adtracking" value="XXXX" /&gt; &lt;input type="hidden" name="meta_message" value="1" /&gt; &lt;input id="awf_field-22176678" type="text" name="name" class="text" value="" tabindex="500" /&gt; &lt;input class="text" id="awf_field-22176679" type="text" name="email" value="" tabindex="501" /&gt; &lt;input name="submit" class="submit" type="submit" value="Submit" tabindex="502" /&gt; &lt;div class="af-clear"&gt; &lt;/form&gt; </code></pre> <p>EDIT 2: I need to do something like this just simplified with jQuery:</p> <pre><code> &lt;?php $formcode = '&lt;form method="post" action="http://www.aweber.com/scripts/addlead.pl" &gt; &lt;input type="hidden" name="meta_web_form_id" value="864136470" /&gt; &lt;input type="hidden" name="listname" value="fbu-ppv-mmoney1" /&gt; &lt;input type="hidden" name="meta_adtracking" value="FB_Ultralizer_PPV" /&gt; &lt;input type="hidden" name="meta_message" value="1" /&gt; &lt;input id="awf_field-22176678" type="text" name="name" class="text" value="" tabindex="500" /&gt; &lt;input class="text" id="awf_field-22176679" type="text" name="email" value="" tabindex="501" /&gt; &lt;input name="submit" class="submit" type="submit" value="Submit" tabindex="502" /&gt; &lt;/form&gt; '; ?&gt; &lt;script type="text/javascript"&gt; customar_formcode="$formcode"; customar_formcode=customar_formcode.replace("{email}", user.email); customar_formcode=customar_formcode.replace("{name}", user.name); document.getElementById(\'form\').submit(); &lt;/script&gt; </code></pre>
    singulars
    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.
    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