Note that there are some explanatory texts on larger screens.

plurals
  1. POJS POST request via form.submit() differs from click one
    primarykey
    data
    text
    <p>I need to submit post method form using javascript, this is the form:</p> <pre><code>&lt;form action="" method="POST"&gt; &lt;p&gt; &lt;input class="button white bigwidth" type="submit" name="imgContinue" value="Continue to image ... "&gt; &lt;/p&gt; &lt;/form&gt; </code></pre> <p>and this is how I try to send it via JS:</p> <pre><code>var form = document.getElementsByTagName("form"); if(form.length != 0) { form[0].submit(); } </code></pre> <p>But it doesn't work the same way as clicking on the button (I checked there is just a jquery click handlers attached)</p> <p>test page: <a href="http://imgmoney.com/img-515f13c1bb27c.html" rel="nofollow">http://imgmoney.com/img-515f13c1bb27c.html</a></p> <p>Any suggestions how to automaticly send the form the same way as user mouse click does it?</p> <p>Request via form.submit()</p> <pre><code>POST http://imgmoney.com/img-515f13c1bb27c.html HTTP/1.1 Host: imgmoney.com Connection: keep-alive Content-Length: 0 Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Origin: http://imgmoney.com User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36 Content-Type: application/x-www-form-urlencoded Referer: http://imgmoney.com/img-515f13c1bb27c.html Accept-Encoding: gzip,deflate,sdch Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4 Cookie: PHPSESSID=b9ef96omfovrk66op827t1sim3; HstCfa2204047=1374076305244; HstCmu2204047=1374076305244; Cls_weather=low%7Bundefined%7Dhigh%7Bundefined%7Dicon%7Bundefined%7Dcondition%7Bundefined%7Dbase%7Bhttp%3A//www.google.com%7Dsug_unit%7BC%7Dcity%7BSaint%20Petersburg%7Dcountry%7BRU%7D; __atuvc=2%7C29; noadvtday=0; ao_s=7; HstCla2204047=1374076527809; HstPn2204047=7; HstPt2204047=7; HstCnv2204047=1; HstCns2204047=1; MLRV_72204047=1374076528372; MLR72204047=1374076518000; __utma=24314786.908711371.1374076306.1374076306.1374076306.1; __utmb=24314786.7.10.1374076306; __utmc=24314786; __utmz=24314786.1374076306.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) </code></pre> <p>and via mouse click by user</p> <pre><code>POST http://imgmoney.com/img-515f13c1bb27c.html HTTP/1.1 Host: imgmoney.com Connection: keep-alive Content-Length: 34 Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Origin: http://imgmoney.com User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36 Content-Type: application/x-www-form-urlencoded Referer: http://imgmoney.com/img-515f13c1bb27c.html Accept-Encoding: gzip,deflate,sdch Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4 Cookie: PHPSESSID=b9ef96omfovrk66op827t1sim3; HstCfa2204047=1374076305244; HstCmu2204047=1374076305244; Cls_weather=low%7Bundefined%7Dhigh%7Bundefined%7Dicon%7Bundefined%7Dcondition%7Bundefined%7Dbase%7Bhttp%3A//www.google.com%7Dsug_unit%7BC%7Dcity%7BSaint%20Petersburg%7Dcountry%7BRU%7D; __atuvc=2%7C29; noadvtday=0; ao_s=8; HstCla2204047=1374076561596; HstPn2204047=8; HstPt2204047=8; HstCnv2204047=1; HstCns2204047=1; __utma=24314786.908711371.1374076306.1374076306.1374076306.1; __utmb=24314786.8.10.1374076306; __utmc=24314786; __utmz=24314786.1374076306.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); MLRV_72204047=1374076562369; MLR72204047=1374076555000 imgContinue=Continue+to+image+...+ </code></pre> <p>And I need to do last request above via JS, any suggestions?</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.
    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