<?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: How to remove form javascript?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/how-to-remove-form-javascript</link>
		<description>Gravity Support Forums Topic: How to remove form javascript?</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 10:46:24 +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/how-to-remove-form-javascript" rel="self" type="application/rss+xml" />

		<item>
			<title>WorldWideWebb on "How to remove form javascript?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-remove-form-javascript#post-74514</link>
			<pubDate>Sun, 09 Sep 2012 12:31:43 +0000</pubDate>
			<dc:creator>WorldWideWebb</dc:creator>
			<guid isPermaLink="false">74514@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;For all those interested, I hacked together my own solution for this. Seems to work well if you're embedding forms via a function call (which I am in the case of my general contact form):&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;include(&#38;#39;/simple_html_dom.php&#38;#39;);
ob_start();
gravity_form(1, false, false, false, &#38;#39;&#38;#39;, true);
$gravity_form_output = ob_get_contents();
ob_end_clean();

$gravity_form_clean = str_get_html($gravity_form_output);
$gravity_form_js = &#38;#39;&#38;#39;;

foreach($gravity_form_clean-&#38;gt;find(&#38;#39;script&#38;#39;) as $script_tag) {
	$gravity_form_js .= $script_tag;
	$script_tag-&#38;gt;outertext = &#38;#39;&#38;#39;;
}

echo $gravity_form_clean;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then, in the footer (after all of your other javascript), you echo the stripped javascript back:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;echo $gravity_form_js;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;All this requires is the PHP Simple HTML DOM Parser, which gives us an easy way to strip out HTML nodes. It can be found here: &#60;a href=&#34;http://simplehtmldom.sourceforge.net/&#34; rel=&#34;nofollow&#34;&#62;http://simplehtmldom.sourceforge.net/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I'm sure this is kinda hacky and definitely isn't supported, but it seems to work (Gravity guys, I'd love to hear if this might cause any issues that you can think of), prevents me from having to touch the plugin so that it can be upgraded properly, and allows me to move jQuery back to the footer.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>WorldWideWebb on "How to remove form javascript?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-remove-form-javascript#post-74491</link>
			<pubDate>Sat, 08 Sep 2012 19:51:58 +0000</pubDate>
			<dc:creator>WorldWideWebb</dc:creator>
			<guid isPermaLink="false">74491@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;How do I suppress the javascript (it's jQuery-specific code) that's output with each form? Even better, how do I move that code block to the footer? I'm pretty adamant about jQuery being referenced only in the footer (for performance reasons, and so my page load isn't blocked while it's being downloaded).&#60;/p&#62;
&#60;p&#62;Thx
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
