<?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: dynamically populate fields based on drop down selection</title>
		<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection</link>
		<description>Gravity Support Forums Topic: dynamically populate fields based on drop down selection</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 15:28:40 +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/dynamically-populate-fields-based-on-drop-down-selection" rel="self" type="application/rss+xml" />

		<item>
			<title>Mattbw11 on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-33498</link>
			<pubDate>Wed, 24 Aug 2011 18:07:18 +0000</pubDate>
			<dc:creator>Mattbw11</dc:creator>
			<guid isPermaLink="false">33498@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks alot Carl! That fixed it...&#60;br /&#62;
Please excuse my lack of php/javascript knowledge. You guys have made modifying things really easy,. Its just a small learning curve and I will be good.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-33490</link>
			<pubDate>Wed, 24 Aug 2011 17:31:01 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">33490@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;It looks like your code is wrong.  You have a &#38;lt; where you shouldn't have one.  Most likely because you have PHP tags when you've placed the PHP within an existing code block.  If the code is already within a PHP tag and you try opening another you'll get this error.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Mattbw11 on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-33485</link>
			<pubDate>Wed, 24 Aug 2011 17:27:37 +0000</pubDate>
			<dc:creator>Mattbw11</dc:creator>
			<guid isPermaLink="false">33485@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello Alex,&#60;br /&#62;
Thanks for your example code to populate a text field based on a drop-down selection.&#60;/p&#62;
&#60;p&#62;I have followed your steps above, and replaced the form ID and field IS's with the correct ones from our form. For some reason I keep getting an error:&#60;br /&#62;
Parse error: syntax error, unexpected '&#38;lt;' in /home/content/58/7982758/html/wp-content/themes/twentyten/functions.php on line 518&#60;/p&#62;
&#60;p&#62;Is there something Im not doing correctly to get this functioning properly? &#60;/p&#62;
&#60;p&#62;I have added this code to the bottom of the functions.php file.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vixvii on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-29052</link>
			<pubDate>Mon, 04 Jul 2011 05:07:42 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">29052@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Tranzbi - Have you sorted out the problem yet?&#60;/p&#62;
&#60;p&#62;I can't give you a direct solution as I am &#34;hacking&#34; my way through it, but maybe this will help. I have the following in my functions.php file : &#60;a href=&#34;http://www.pastie.org/2161836&#34; rel=&#34;nofollow&#34;&#62;http://www.pastie.org/2161836&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;And then this is the code of the test.php file : &#60;a href=&#34;http://www.pastie.org/2161843&#34; rel=&#34;nofollow&#34;&#62;http://www.pastie.org/2161843&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Hope it helps
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tranzbi on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-28656</link>
			<pubDate>Tue, 28 Jun 2011 00:57:18 +0000</pubDate>
			<dc:creator>tranzbi</dc:creator>
			<guid isPermaLink="false">28656@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is a great solution to my problem. However, I want to populate the second drop down with another list based on the previous drop down value. I can do this using ajax base on the previous drop down value I can query the database and return another drop down list, but I am not sure how to dynamically populate the list into the second drop down. Please help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vixvii on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-28500</link>
			<pubDate>Fri, 24 Jun 2011 13:50:37 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">28500@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you Alex! This is perfect and the jQuery documentation will get me further.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-28485</link>
			<pubDate>Fri, 24 Jun 2011 11:49:41 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">28485@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Try the following, making sure you replace 167 with your Form ID and 1 and 3 with your field IDs. jQuery has very good documentation online if you need any more help with it. &#60;a href=&#34;http://jquery.com&#34; rel=&#34;nofollow&#34;&#62;http://jquery.com&#60;/a&#62;&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
add_filter(&#38;quot;gform_pre_render_167&#38;quot;, &#38;quot;monitor_dropdown&#38;quot;);
function monitor_dropdown($form){

?&#38;gt;
    &#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
    jQuery(document).ready(function(){

        jQuery(&#38;#39;#input_167_3&#38;#39;).bind(&#38;#39;change&#38;#39;, function()
        {
            //get selected value from drop down;
            var selectedValue = jQuery(&#38;quot;#input_167_3&#38;quot;).val();

            //populate a text field with the selected drop down value
            jQuery(&#38;quot;#input_167_1&#38;quot;).val(selectedValue);
        });
    });
    &#38;lt;/script&#38;gt;
&#38;lt;?php

return $form;
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>vixvii on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-28478</link>
			<pubDate>Fri, 24 Jun 2011 10:47:15 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">28478@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Any chance you could just get me started with jQuery? I understand the concept of jQuery, but I am taking it on as a new venture. I know where to put the code but I am not sure what the syntax is for communicating with a form and a field on the form? My current code looks like this :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_pre_render_11&#38;quot;, monitor_dropdown);
function monitor_dropdown($form){

?&#38;gt;
	&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
	jQuery(document).ready(function(){	

		jQuery(&#38;#39;#input_3&#38;#39;).bind(&#38;#39;onchange&#38;#39;, function ()
			{
			alert(&#38;quot;test&#38;quot;);
			});
	});
	&#38;lt;/script&#38;gt;
&#38;lt;?php

return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I think once I have the basics I will be able to figure out the rest.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vixvii on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-28191</link>
			<pubDate>Mon, 20 Jun 2011 14:57:33 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">28191@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks again Carl!    jQuery makes complete sense
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "dynamically populate fields based on drop down selection"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-based-on-drop-down-selection#post-28189</link>
			<pubDate>Mon, 20 Jun 2011 14:52:58 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">28189@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You could only do this with custom jQuery.  You'd have to write custom jQuery and attach it to the drop down field and then use jQuery to populate the fields with the data.  There is no hook on drop downs because no PHP is triggered by a drop down so you have to do it using jQuery.&#60;/p&#62;
&#60;p&#62;To execute code when the form is submitted you can use the gform_pre_submission hook or the gform_post_submission hook.  Both will do the trick. &#60;/p&#62;
&#60;p&#62;Pre Submission hook documentation is here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_pre_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_pre_submission&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Post Submission hook documentation is here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_post_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_post_submission&#60;/a&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
