<?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 add JavaScript functionality</title>
		<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality</link>
		<description>Gravity Support Forums Topic: How to add JavaScript functionality</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 12:36:13 +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-add-javascript-functionality" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-44527</link>
			<pubDate>Tue, 20 Dec 2011 13:51:23 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">44527@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Awesome. Thanks for posting back. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Lea Cohen on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-44501</link>
			<pubDate>Tue, 20 Dec 2011 04:38:55 +0000</pubDate>
			<dc:creator>Lea Cohen</dc:creator>
			<guid isPermaLink="false">44501@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I uploaded to our production server, and surprisingly  - everything works well... Maybe our dev server was just acting up :) Thank you very much for all your help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-44370</link>
			<pubDate>Mon, 19 Dec 2011 14:18:23 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">44370@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi leac,&#60;/p&#62;
&#60;p&#62;I can't think of anything offhand that would prevent the confirmation or GF hooks from firing. If you send me your FTP info I can take a look: &#60;a href=&#34;mailto:david@rocketgenius.com&#34;&#62;david@rocketgenius.com&#60;/a&#62;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Lea Cohen on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-44317</link>
			<pubDate>Sun, 18 Dec 2011 02:44:53 +0000</pubDate>
			<dc:creator>Lea Cohen</dc:creator>
			<guid isPermaLink="false">44317@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you! That seems to have solved my problem!&#60;/p&#62;
&#60;p&#62;It seems, though, that I have a problem with the submission of the post. The post is created, but the user never gets to the thank-you confirmation, and the function that I run on &#60;code&#62;gform_post_submission&#60;/code&#62; doesn't do its work. But if I *don't* enqueue the CSS and JS of the jQuery, then the submission works fine - the user gets the thank-you message, and the function runs.&#60;br /&#62;
This happens when I use my own page template. However when I switch to the default template, everything works fine. &#60;/p&#62;
&#60;p&#62;This is my page template:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
 /*
 Template Name: plain page
 */
?&#38;gt;
&#38;lt;!DOCTYPE html&#38;gt;
&#38;lt;html&#38;lt;?php language_attributes(); ?&#38;gt;&#38;gt;
&#38;lt;head charset=&#38;quot;&#38;lt;?php bloginfo( &#38;#39;charset&#38;#39; ); ?&#38;gt;&#38;quot;&#38;gt;
  &#38;lt;title&#38;gt;Upload Form&#38;lt;/title&#38;gt;

&#38;lt;?php

	/* Always have wp_head() just before the closing &#38;lt;/head&#38;gt;
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to add elements to &#38;lt;head&#38;gt; such
	 * as styles, scripts, and meta tags.
	 */
	wp_head();
?&#38;gt;
  &#38;lt;/head&#38;gt;
&#38;lt;body&#38;gt;

  &#38;lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&#38;gt;
  &#38;lt;?php the_content(&#38;#39;read more&#38;#39;); ?&#38;gt;
  &#38;lt;?php endwhile; endif; ?&#38;gt;
  &#38;lt;?php wp_footer(); ?&#38;gt;

&#38;lt;/body&#38;gt;
&#38;lt;/html&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Smith on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-44273</link>
			<pubDate>Fri, 16 Dec 2011 18:11:47 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">44273@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi leac,&#60;/p&#62;
&#60;p&#62;The first thing I noticed was that you are loading the form via thickboxes ajax content method. This is where thickbox retrieves the actual content of the requested page and loads it into the thickbox window. This isn't an ideal approach for what you're trying to do because you essentially now have two copies of all the scripts loaded on the page; one copy from the page you're on and one copy from the form page you're loading.&#60;/p&#62;
&#60;p&#62;I'd recommend using thickbox's iframe functionality to load the form page in an iframe. Let me know if the issues continue after you've done this.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Lea Cohen on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-44133</link>
			<pubDate>Thu, 15 Dec 2011 08:01:43 +0000</pubDate>
			<dc:creator>Lea Cohen</dc:creator>
			<guid isPermaLink="false">44133@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You're right. I enqueued them as follows:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if (is_page(213)){
             wp_enqueue_style(&#38;#39;jQuery-ui&#38;#39;,&#38;#39;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css&#38;#39;);
            wp_enqueue_style(&#38;#39;forms&#38;#39;, get_bloginfo(&#38;#39;template_directory&#38;#39;).&#38;#39;/css/forms.css&#38;#39;, null, &#38;#39;1.0&#38;#39;);
            wp_enqueue_script(&#38;#39;jQuery-ui&#38;#39;,&#38;#39;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js&#38;#39;,&#38;#39;1&#38;#39;,true);
            wp_enqueue_script(&#38;quot;forms-js&#38;quot;, get_bloginfo(&#38;#39;template_directory&#38;#39;).&#38;#39;/js/forms.js&#38;#39;, array(&#38;#39;jQuery-ui&#38;#39;), &#38;#39;1&#38;#39;,true);

        }&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The thing is, that my script - forms.js - includes all kinds of jQuery commands. Only the ones having to do with autocomplete don't work (i.e work only on 2nd load). The others work fine on each load.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://dev.linux.ort.org.il/nanotest/wp-content/themes/twentyten/js/forms.js?ver=1&#34; rel=&#34;nofollow&#34;&#62;Link to the JS file &#60;/a&#62;&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://dev.linux.ort.org.il/nanotest/?page_id=213&#34; rel=&#34;nofollow&#34;&#62;Link to form&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I'd appreciate you help
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-43913</link>
			<pubDate>Tue, 13 Dec 2011 10:35:37 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">43913@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If moving your scripts to after the scripts are being included by wp_head, then the order of the scripts is probably wrong and there is an unmet dependency.  For example, a script that relies on jQuery is being added before jQuery is included.&#60;/p&#62;
&#60;p&#62;Hard-coding them is not the best way to go.  You might want to enqueue your scripts so they're included in the proper order by wp_head().  Here is the documentation for using that WordPress function:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://codex.wordpress.org/Function_Reference/wp_enqueue_script&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Function_Reference/wp_enqueue_script&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Look specifically at $deps or dependencies.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Lea Cohen on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-43892</link>
			<pubDate>Tue, 13 Dec 2011 07:03:40 +0000</pubDate>
			<dc:creator>Lea Cohen</dc:creator>
			<guid isPermaLink="false">43892@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;OK, I tried something, and it worked: I moved the call to wp_head() to be before my script tags, and that helped. Now it works when the form is opened in its own page, but not when the it's opened with thickbox. &#60;/p&#62;
&#60;p&#62;I saw that wp_head merely adds scripts and links, so I copied those scripts to my page template, and cancelled the call to wp_head. Then I saw that of course both wp_head and I call jQuery, just with different versions. So I removed the call that wp_head brought and only used mine, and now the form opens with thickbox, &#60;strong&#62;and&#60;/strong&#62; my autocomplete runs... &#60;/p&#62;
&#60;p&#62;But this seems like a workaround, and not the best way to do things, doesn't it?...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Lea Cohen on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-43879</link>
			<pubDate>Tue, 13 Dec 2011 02:42:45 +0000</pubDate>
			<dc:creator>Lea Cohen</dc:creator>
			<guid isPermaLink="false">43879@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yes, it does, as I added it and it fixed the &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/required-field-with-condidtion#post-43742&#34; rel=&#34;nofollow&#34;&#62;conditional field problem&#60;/a&#62;. The direct link to the form is &#60;a href=&#34;http://dev.linux.ort.org.il/nanotest/?page_id=213&#38;amp;width=790&#34; rel=&#34;nofollow&#34;&#62;http://dev.linux.ort.org.il/nanotest/?page_id=213&#38;amp;width=790&#60;/a&#62; (the link in my previous post was wrong )
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "How to add JavaScript functionality"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-add-javascript-functionality#post-43762</link>
			<pubDate>Mon, 12 Dec 2011 10:41:29 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">43762@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Does your page template include the function call to wp_head()?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
