<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Auto submit form after 5 seconds</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=11307465" />
  <subtitle>Auto submit form after 5 seconds</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=11307465</id>
  <updated>2026-07-12T05:07:44Z</updated>
  <dc:date>2026-07-12T05:07:44Z</dc:date>
  <entry>
    <title>RE: Auto submit form after 5 seconds</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11323831" />
    <author>
      <name>Jason Roscoe</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11323831</id>
    <updated>2011-11-04T19:49:32Z</updated>
    <published>2011-11-04T19:49:32Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I actually got this working using the below:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
&amp;lt;script type="text/javascript"&amp;gt;
		window.onload=function(){
			window.setTimeout('document.qrcodeRedirectForm.submit()', 500)
		}
	&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Thanks.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Jason Roscoe</dc:creator>
    <dc:date>2011-11-04T19:49:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auto submit form after 5 seconds</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11321814" />
    <author>
      <name>Jason Roscoe</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11321814</id>
    <updated>2011-11-04T16:45:42Z</updated>
    <published>2011-11-04T16:45:42Z</published>
    <summary type="html">I implemented your suggestion, but now page is not getting auto submitted at all.</summary>
    <dc:creator>Jason Roscoe</dc:creator>
    <dc:date>2011-11-04T16:45:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auto submit form after 5 seconds</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11310602" />
    <author>
      <name>Deb Troxel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11310602</id>
    <updated>2011-11-03T20:51:33Z</updated>
    <published>2011-11-03T20:51:33Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Jason,&lt;br&gt;Try &lt;br&gt;&lt;pre&gt;&lt;code&gt;           setTimeout(document.qrcodeRedirectForm.submit,6000);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;That is - remove the parens after submit.  You're calling submit() when you're setting the timeout, when what you want to do is pass the submit function reference.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Deb Troxel</dc:creator>
    <dc:date>2011-11-03T20:51:33Z</dc:date>
  </entry>
  <entry>
    <title>Auto submit form after 5 seconds</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11307464" />
    <author>
      <name>Jason Roscoe</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11307464</id>
    <updated>2011-11-03T17:18:57Z</updated>
    <published>2011-11-03T17:18:57Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I have a customer portlet, that I would like to auto submit a form in this portlet after x number of sceonds, let's say 5 for example.  I have the below in my xhtml file;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
&amp;lt;form id="qrcodeRedirectForm" name="qrcodeRedirectForm" method="post" action="${formAction}"&amp;gt;		
		&amp;lt;input type="hidden" name="qr_code_identifier" id="qr_code_identifier" value="${qr_code_identifier}"&amp;gt;				
		&amp;lt;div class="enroll-button"&amp;gt;
			&amp;lt;p&amp;gt;&amp;lt;input type="submit" value="Submit" class="inputButton"&amp;gt;&amp;lt;/p&amp;gt;
		&amp;lt;/div&amp;gt;
		&amp;lt;noscript&amp;gt;
			&amp;lt;p&amp;gt;
				Please click the below button to go to the page you requested.
			&amp;lt;/p&amp;gt;
			&amp;lt;p&amp;gt;
				&amp;lt;input type="submit" value="Submit" class="inputButton"&amp;gt;
			&amp;lt;/p&amp;gt;
		&amp;lt;/noscript&amp;gt;
	&amp;lt;/form&amp;gt;
	&amp;lt;script type="text/javascript"&amp;gt;
		jQuery(document).ready(function() {
		   setTimeout(document.qrcodeRedirectForm.submit(),6000);
		});   
	&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;the above seems to work, but it is not waitinf for 5 seconds.  It is redirecting almost immediately.  I can change the setTimeout call to be 60000, and it redirects immediately.  Any suggestions?&lt;br&gt;&lt;br&gt;Thanks!!&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Jason Roscoe</dc:creator>
    <dc:date>2011-11-03T17:18:57Z</dc:date>
  </entry>
</feed>
