<?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: Detect if form has submitted</title>
		<link>https://legacy.forums.gravityhelp.com/topic/detect-if-form-has-submitted</link>
		<description>Gravity Support Forums Topic: Detect if form has submitted</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:46:57 +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/detect-if-form-has-submitted" rel="self" type="application/rss+xml" />

		<item>
			<title>g01010 on "Detect if form has submitted"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/detect-if-form-has-submitted#post-51578</link>
			<pubDate>Wed, 07 Mar 2012 05:23:15 +0000</pubDate>
			<dc:creator>g01010</dc:creator>
			<guid isPermaLink="false">51578@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for your help. I'll look into this.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Detect if form has submitted"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/detect-if-form-has-submitted#post-51517</link>
			<pubDate>Tue, 06 Mar 2012 18:51:29 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">51517@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You will go about things a different way with Gravity Forms.  You will need to use hooks to accomplish what you want to do.  &#60;/p&#62;
&#60;p&#62;You would write custom PHP and that custom code would go in either your themes functions.php file, or you could create your own custom WordPress plugin to house that custom code and then activate that plugin.&#60;/p&#62;
&#60;p&#62;The hook you would use when the form is submitted to set the cookie is the gform_after_submission hook which is documented here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_after_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_after_submission&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;This is the hook you would use to implement your custom code to create the cookie.&#60;/p&#62;
&#60;p&#62;After the cookie exists you will then need to write the PHP in your theme template to check to see if the cookie exists or not and then respond accordingly.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>g01010 on "Detect if form has submitted"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/detect-if-form-has-submitted#post-51409</link>
			<pubDate>Tue, 06 Mar 2012 07:09:43 +0000</pubDate>
			<dc:creator>g01010</dc:creator>
			<guid isPermaLink="false">51409@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for this - I'm comfortable with everything you suggest... It's just the really fundamental thing of how to detect whether the form has been submitted when I don't know and can't specify the name for fields and/or the submit button.&#60;/p&#62;
&#60;p&#62;Normally I'd do this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ( isset ( $_POST [&#38;#39;submit&#38;#39;] ) ) {
  //do stuff
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;But I can't do that without knowing the name of the Submit button... So all the rest of what you suggest makes perfect sense, I just can't get past the first and most basic step.&#60;/p&#62;
&#60;p&#62;EDIT:&#60;/p&#62;
&#60;p&#62;So I did a bit more playing around. Am I right that GF automatically adds a hidden field called gform_submit?&#60;/p&#62;
&#60;p&#62;I've used this to test whether the form has submitted:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ( isset ( $_POST [&#38;#39;gform_submit&#38;#39;] ) ) {
  //do stuff
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Grateful if you could let me know if you see any problems with that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Detect if form has submitted"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/detect-if-form-has-submitted#post-51361</link>
			<pubDate>Mon, 05 Mar 2012 18:27:52 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">51361@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Here's what you could do...&#60;/p&#62;
&#60;p&#62;- Write custom PHP so that when the form is submitted, you set a cookie in the users browser containing the post/page id.&#60;/p&#62;
&#60;p&#62;- Write custom PHP in your theme template that is used to display your posts and/or pages so that posts that require a form submission check to see if the cookie exists, and if it does... if the post id for the post the user is viewing is in the cookie.  If it is, show the post content.  If it is not, show the form.&#60;/p&#62;
&#60;p&#62;This is a high level overview of what you would need to do.  If this isn't something you can implement yourself based on your knowledge of WordPress then I could refer you to a list of WordPress developers who could assist you with this customization.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>g01010 on "Detect if form has submitted"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/detect-if-form-has-submitted#post-51348</link>
			<pubDate>Mon, 05 Mar 2012 16:46:17 +0000</pubDate>
			<dc:creator>g01010</dc:creator>
			<guid isPermaLink="false">51348@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for your response... &#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;Is the form you want them to fill out going to be the same for every page?&#60;/blockquote&#62;
 Yes.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;Are you fine with this being cookie based so it uses browser cookies to know if it should show the content or not?&#60;/blockquote&#62;
 Yes.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Detect if form has submitted"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/detect-if-form-has-submitted#post-51345</link>
			<pubDate>Mon, 05 Mar 2012 16:39:15 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">51345@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This isn't a built in feature so it's not something Gravity Forms itself is going to do for you.  It is possible, but it would have to be implemented as a customization.  &#60;/p&#62;
&#60;p&#62;I've actually never seen this particular question asked before so it's not something i've thought about so I don't have a solution off the top of my head.&#60;/p&#62;
&#60;p&#62;There are probably a variety of ways to handle this but ultimately it's going to depend on your specific use case.  I can try and come up with a way to handle it but i'll need to know a little more information...&#60;/p&#62;
&#60;p&#62;Is the form you want them to fill out going to be the same for every page?  Are you fine with this being cookie based so it uses browser cookies to know if it should show the content or not?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>g01010 on "Detect if form has submitted"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/detect-if-form-has-submitted#post-51291</link>
			<pubDate>Mon, 05 Mar 2012 11:11:51 +0000</pubDate>
			<dc:creator>g01010</dc:creator>
			<guid isPermaLink="false">51291@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I thought this would be easy (and it probably is) but I haven't been able to figure it out.&#60;/p&#62;
&#60;p&#62;I'd like to hide page content from the user until they successfully submit a form on the same page. Doing this on different pages would be easy - I could just pass a variable from the page with the form on to the next page. But I can't work out how to do it on the same page.&#60;/p&#62;
&#60;p&#62;Any clues?&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
