<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Running javascript on &#34;next page&#34; click</title>
		<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click</link>
		<description>Gravity Support Forums Topic: Running javascript on &quot;next page&quot; click</description>
		<language>en-US</language>
		<pubDate>Wed, 22 Apr 2026 19:52:37 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/running-javascript-on-next-page-click" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "Running javascript on &#34;next page&#34; click"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click#post-14179</link>
			<pubDate>Fri, 10 Dec 2010 12:00:38 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">14179@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;A Javascript hook makes complete sense. Send me an email to &#60;a href=&#34;mailto:alex@rocketgenius.com&#34;&#62;alex@rocketgenius.com&#60;/a&#62; and I will send you our latest version with that hook.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Running javascript on &#34;next page&#34; click"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click#post-14154</link>
			<pubDate>Thu, 09 Dec 2010 17:30:50 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">14154@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alex will be responding soon, he has to take a look at what you are trying to do and see what the solution is.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>m4change on "Running javascript on &#34;next page&#34; click"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click#post-14146</link>
			<pubDate>Thu, 09 Dec 2010 16:06:17 +0000</pubDate>
			<dc:creator>m4change</dc:creator>
			<guid isPermaLink="false">14146@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Any ideas on this?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>m4change on "Running javascript on &#34;next page&#34; click"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click#post-13932</link>
			<pubDate>Mon, 06 Dec 2010 11:54:02 +0000</pubDate>
			<dc:creator>m4change</dc:creator>
			<guid isPermaLink="false">13932@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I can't seem to get new setTimeout working with this hook.  Though, the only reason I need setTimeout is  because it appears the javascript is running before the elements on the page are drawn.  The reason this is relevant is because I'm trying to skin the form with jquery ui.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;echo &#38;#39;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;setTimeout(&#38;quot;alert(\&#38;#39;hello\&#38;#39;)&#38;quot;,1250);&#38;lt;/script&#38;gt;&#38;#39;;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;it's worth noting the following works:&#60;br /&#62;
&#60;code&#62;echo &#38;#39;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;alert(\&#38;#39;hello\&#38;#39;);&#38;lt;/script&#38;gt;&#38;#39;;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;However, I cannot skin the elements this way.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>m4change on "Running javascript on &#34;next page&#34; click"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click#post-12935</link>
			<pubDate>Thu, 18 Nov 2010 16:54:16 +0000</pubDate>
			<dc:creator>m4change</dc:creator>
			<guid isPermaLink="false">12935@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In this case, I'd have to do inline javascript though correct?&#60;/p&#62;
&#60;p&#62;i.e.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_paging&#38;quot;, &#38;quot;page_changed&#38;quot;, 10, 3);
function page_changed($form, $source_page, $target_page){
    echo &#38;#39;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;alert(&#38;quot;you&#38;#39;ve done it!&#38;quot;);&#38;lt;/script&#38;gt;&#38;#39;;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I was hoping for a pure javascript hook.&#60;/p&#62;
&#60;p&#62;Here is my hacky implementation, hardcoded to a form and page&#60;/p&#62;
&#60;p&#62;&#60;code&#62;$onclick = &#38;quot;onclick=&#38;#39;jQuery(\&#38;quot;#gform_target_page_number_{$form_id}\&#38;quot;).val(\&#38;quot;{$target_page_number}\&#38;quot;); jQuery(\&#38;quot;#gform_{$form_id}\&#38;quot;).trigger(\&#38;quot;submit\&#38;quot;,[true]); if ({$form_id}==3 &#38;amp;&#38;amp; {$target_page_number}==2) { setTimeout(\&#38;quot;do_it()\&#38;quot;, 1000); }&#38;#39;&#38;quot;;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;My programming teacher would probably roll his eyes at this solution but sometimes you've just gotta do the dirty dirty.  You'll notice I had to set a timeout to a second so it doesn't fire the function until after the HTML in injected. This however causes a slight flash in the display.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Running javascript on &#34;next page&#34; click"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click#post-12932</link>
			<pubDate>Thu, 18 Nov 2010 16:07:15 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">12932@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Gravity Forms v1.5 Beta 2 was released earlier today and contains a hook that fires when you click back or forward.  &#60;/p&#62;
&#60;p&#62;Here is an example:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_paging&#38;quot;, &#38;quot;page_changed&#38;quot;, 10, 3);
function page_changed($form, $source_page, $target_page){
    echo &#38;quot;Page changed from $source_page to $target_page&#38;quot;;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>m4change on "Running javascript on &#34;next page&#34; click"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click#post-12913</link>
			<pubDate>Thu, 18 Nov 2010 14:02:03 +0000</pubDate>
			<dc:creator>m4change</dc:creator>
			<guid isPermaLink="false">12913@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Oh, I figured that'd be all PHP based.&#60;/p&#62;
&#60;p&#62;Is there anyway I can hack this in right now?  Hints on where I can inject my needs as a stop gap measure until this feature is complete? This form is time sensitive.&#60;/p&#62;
&#60;p&#62;edit: looks like I can hack line 415 in form_display.php
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Running javascript on &#34;next page&#34; click"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click#post-12907</link>
			<pubDate>Thu, 18 Nov 2010 13:19:53 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">12907@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alex already touched on this here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://forum.gravityhelp.com/topic/bug-gform_post_submission-called-on-next-page#post-12892&#34; rel=&#34;nofollow&#34;&#62;http://forum.gravityhelp.com/topic/bug-gform_post_submission-called-on-next-page#post-12892&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;We will be adding a hook that fires after each page.  It's not currently available.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>m4change on "Running javascript on &#34;next page&#34; click"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/running-javascript-on-next-page-click#post-12902</link>
			<pubDate>Thu, 18 Nov 2010 13:01:38 +0000</pubDate>
			<dc:creator>m4change</dc:creator>
			<guid isPermaLink="false">12902@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have some data that needs to be formatted via javascript on page 2 of my form.  How can I trigger this javascript?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
