<?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 Populating a Custom Field Drop Down</title>
		<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populating-a-custom-field-drop-down</link>
		<description>Gravity Support Forums Topic: Dynamically Populating a Custom Field Drop Down</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 05:19:25 +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-populating-a-custom-field-drop-down" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Dynamically Populating a Custom Field Drop Down"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populating-a-custom-field-drop-down#post-75248</link>
			<pubDate>Thu, 13 Sep 2012 23:27:32 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">75248@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is a customization beyond the support we can provide here.  Sounds like you need help from someone versed in PHP or WordPress to help you with this.  You can find some resources on our job board: &#60;a href=&#34;http://www.gravityhelp.com/forums/forum/job-board&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/forum/job-board&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>marcusk on "Dynamically Populating a Custom Field Drop Down"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populating-a-custom-field-drop-down#post-75126</link>
			<pubDate>Thu, 13 Sep 2012 11:40:20 +0000</pubDate>
			<dc:creator>marcusk</dc:creator>
			<guid isPermaLink="false">75126@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Tried an alternative method by doing predefined choices:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_predefined_choices&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_predefined_choices&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I'm still getting the same problem however. Source code below:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_predefined_choices&#38;quot;, &#38;quot;add_predefined_choice&#38;quot;);

function add_predefined_choice($choices){

	$con = mysql_connect(&#38;quot;localhost&#38;quot;,&#38;quot;root&#38;quot;,&#38;quot;&#38;quot;);
	if (!$con)
  	{
  	die(&#38;#39;Could not connect: &#38;#39; . mysql_error());
  	}

	mysql_select_db(&#38;quot;asm&#38;quot;, $con);

	$result = mysql_query(&#38;quot;SELECT * FROM &#38;lt;code&#38;gt;wp_cimy_uef_fields&#38;lt;/code&#38;gt; WHERE ID = &#38;#39;1&#38;#39;&#38;quot;);
	$label = mysql_fetch_assoc($result);
	$company = $label[VALUE];

	$choices[&#38;quot;Company List&#38;quot;] = array($company);
	return $choices;

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Please help
&#60;/p&#62;</description>
		</item>
		<item>
			<title>marcusk on "Dynamically Populating a Custom Field Drop Down"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populating-a-custom-field-drop-down#post-74967</link>
			<pubDate>Wed, 12 Sep 2012 12:04:53 +0000</pubDate>
			<dc:creator>marcusk</dc:creator>
			<guid isPermaLink="false">74967@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, I have the drop down values in an array (Company A, Company B, Company C, Others). I tried to make use of the gform_pre_render but I'm not really good at it. The result I got was a drop down list with only 1 item ie Company A, Company B, Company C, Others instead of it being 4 items in the list. Please help. (Source code below)&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function populate_dropdown($form){

  $con = mysql_connect(&#38;quot;localhost&#38;quot;,&#38;quot;root&#38;quot;,&#38;quot;&#38;quot;);
  if (!$con)
    {
    die(&#38;#39;Could not connect: &#38;#39; . mysql_error());
    }

  mysql_select_db(&#38;quot;asm&#38;quot;, $con);

  $result = mysql_query(&#38;quot;SELECT * FROM &#38;lt;code&#38;gt;wp_cimy_uef_fields&#38;lt;/code&#38;gt; WHERE ID = &#38;#39;1&#38;#39;&#38;quot;);
  $label = mysql_fetch_assoc($result);
  $company = array();
  $company = $label[LABEL];

  $items = array();
  $items[] = array(&#38;quot;text&#38;quot; =&#38;gt; &#38;quot;&#38;quot;, &#38;quot;value&#38;quot; =&#38;gt; &#38;quot;&#38;quot;);

  $items[] = array(&#38;quot;text&#38;quot; =&#38;gt; $company, &#38;quot;value&#38;quot; =&#38;gt; $company);

  foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field)
        if($field[&#38;quot;id&#38;quot;] == 18){
            $field[&#38;quot;choices&#38;quot;] = $items;
        }
  return $form;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Dynamically Populating a Custom Field Drop Down"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populating-a-custom-field-drop-down#post-74649</link>
			<pubDate>Mon, 10 Sep 2012 10:37:09 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">74649@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi marcusk, you'll be wanting to look at gform_pre_render:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_pre_render&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_pre_render&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>marcusk on "Dynamically Populating a Custom Field Drop Down"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populating-a-custom-field-drop-down#post-74599</link>
			<pubDate>Mon, 10 Sep 2012 05:11:18 +0000</pubDate>
			<dc:creator>marcusk</dc:creator>
			<guid isPermaLink="false">74599@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, I have extended user registration fields using Cimmy User Extra Fields plugin and added a dropdown box of a list of companies. &#60;/p&#62;
&#60;p&#62;What I need to do is to insert the same field into a GF form by pre populating the data from the wp_cimy_uef_fields MySQL table where Cimmy plugin has stored the information. &#60;/p&#62;
&#60;p&#62;Been searching forum and documentation but can't seem to find a solution. Is this possible and how do I go about doing it if yes.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
