<?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: Custom jQuery -Default value for Name field, Clearit + move labels + description</title>
		<link>https://legacy.forums.gravityhelp.com/topic/where-should-i-place-custom-jquery</link>
		<description>Gravity Support Forums Topic: Custom jQuery -Default value for Name field, Clearit + move labels + description</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 20:38: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/where-should-i-place-custom-jquery" rel="self" type="application/rss+xml" />

		<item>
			<title>redhillcrea.tv on "Custom jQuery -Default value for Name field, Clearit + move labels + description"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-should-i-place-custom-jquery#post-56744</link>
			<pubDate>Fri, 27 Apr 2012 02:20:37 +0000</pubDate>
			<dc:creator>redhillcrea.tv</dc:creator>
			<guid isPermaLink="false">56744@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Btw, &#60;/p&#62;
&#60;p&#62;I changed the location of the gravityforms.js file to /wp-content/uploads/custom/gravityform.js and change the header.php file to:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;!-- gravity form jQuery addons --&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;/wp-content/uploads/custom/gravityform.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
&#38;lt;/head&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This is to move the file out of the theme folder so that theme updates wont delete the gravityforms.js file by mistake :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>redhillcrea.tv on "Custom jQuery -Default value for Name field, Clearit + move labels + description"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-should-i-place-custom-jquery#post-56743</link>
			<pubDate>Fri, 27 Apr 2012 02:05:54 +0000</pubDate>
			<dc:creator>redhillcrea.tv</dc:creator>
			<guid isPermaLink="false">56743@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ok,&#60;/p&#62;
&#60;p&#62;So here is an update for anybody interested:&#60;/p&#62;
&#60;p&#62;1. // Clear default field values OnFocus&#60;br /&#62;
WORKS, just don't forget to add &#34;clearit&#34; to the CSS class name.&#60;/p&#62;
&#60;p&#62;2 // Default value for Name fields&#60;br /&#62;
WORKS, but you will need to change #input_1_1.3 to #input_1_1_3 and #input_1_1.6 to #input_1_1_6 (or what ever your own custom #input ID is. Each form is different, so you should use Firebug to check it.&#60;/p&#62;
&#60;p&#62;3: // Move Sub labels ABOVE input fields &#38;amp; select fields&#60;br /&#62;
Still working on it. One thing that I have thought of was to simply NOT display the sub labels at all, as I was changing the default value to First name and Surname already.so I added display: none; to my theme css like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;/* First Name (Left) Text */
body #gform_wrapper_1 .gform_body .gform_fields .gfield .ginput_complex .ginput_left label {
	color:  #000000;
	display: none;
	}	

/* Last name (Right) Text */
body #gform_wrapper_1 .gform_body .gform_fields .gfield .ginput_complex .ginput_right label {
	color: #000000;
	display: none;
	}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This forces the sub labels to NOT display.&#60;/p&#62;
&#60;p&#62;4: // Place field descriptions above fields&#60;br /&#62;
Still working on it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>redhillcrea.tv on "Custom jQuery -Default value for Name field, Clearit + move labels + description"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/where-should-i-place-custom-jquery#post-56739</link>
			<pubDate>Fri, 27 Apr 2012 01:10:22 +0000</pubDate>
			<dc:creator>redhillcrea.tv</dc:creator>
			<guid isPermaLink="false">56739@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Team,&#60;/p&#62;
&#60;p&#62;I have been trying to add the following custom jQuery scripts to my Gravity Forms:&#60;/p&#62;
&#60;p&#62;Add default value for Name field(s)&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/add-default-value-for-name-fields&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/add-default-value-for-name-fields&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Clearing Default Field Values with jQuery&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Change position of sub-labels on advanced fields&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/change-position-of-sub-labels-on-advanced-fields&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/change-position-of-sub-labels-on-advanced-fields&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Request setting to place field descriptions above fields&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/request-setting-to-place-field-descriptions-above-fields#post-12697&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/request-setting-to-place-field-descriptions-above-fields#post-12697&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I have incorporated all of them into a single gravityforms.js file that looks like this:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;// clear default field values OnFocus
jQuery(document).ready(function() {

	jQuery.fn.cleardefault = function() {
	return this.focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = &#38;quot;&#38;quot;;
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
};
jQuery(&#38;quot;.clearit input, .clearit textarea&#38;quot;).cleardefault();

});

// Default value for Name fields
jQuery(document).ready(function() {
	jQuery(&#38;quot;#input_1_2.3&#38;quot;).attr(&#38;quot;value&#38;quot;, &#38;quot;enter your first name&#38;quot;);
	jQuery(&#38;quot;#input_1_2.6&#38;quot;).attr(&#38;quot;value&#38;quot;, &#38;quot;enter your last name&#38;quot;);
});

// Move Sub labels ABOVE input fields &#38;amp; select fields
      jQuery(document).ready(function() {

          jQuery(&#38;#39;.ginput_container label&#38;#39;).each(function(i,e){
              fielddesc = jQuery(&#38;#39;&#38;lt;div&#38;gt;&#38;#39;).append(jQuery(e).clone()).remove().html();
              jQuery(e).siblings(&#38;#39;.ginput_container input&#38;#39;).before(fielddesc); //moves sub label above input fields
              jQuery(e).siblings(&#38;#39;.ginput_container select&#38;#39;).before(fielddesc); //moves sub label above select fields (e.g. country drop-down)
              jQuery(e).remove();
          });

      });

// Place field descriptions above fields

	jQuery(document).ready(function() {

		jQuery(&#38;#39;.gfield_description&#38;#39;).each(function(i,e){
		    fielddesc = jQuery(&#38;#39;&#38;lt;div&#38;gt;&#38;#39;).append(jQuery(e).clone()).remove().html();
		    jQuery(e).siblings(&#38;#39;label.gfield_label&#38;#39;).after(fielddesc);
		    jQuery(e).remove();
		});

	});&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then I have called the file in my header.php file,:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;!-- gravity form jQuery addons --&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;&#38;lt;?php bloginfo(&#38;quot;template_directory&#38;quot;); ?&#38;gt;/js/gravityform.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
&#38;lt;/head&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;As you can see, I have placed this just before &#38;lt;/head&#38;gt;, so that it loads after the jQuery script in my theme.&#60;/p&#62;
&#60;p&#62;Problem is, THIS DOES NOT WORK on the form.&#60;/p&#62;
&#60;p&#62;Am i missing something?&#60;/p&#62;
&#60;p&#62;Thanks in advance
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
