<?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: populate a list using a shortcode goes wrong when item includes a comma</title>
		<link>https://legacy.forums.gravityhelp.com/topic/populate-a-list-using-a-shortcode-goes-wrong-when-item-includes-a-comma</link>
		<description>Gravity Support Forums Topic: populate a list using a shortcode goes wrong when item includes a comma</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 18:49:53 +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/populate-a-list-using-a-shortcode-goes-wrong-when-item-includes-a-comma" rel="self" type="application/rss+xml" />

		<item>
			<title>Sjoerd on "populate a list using a shortcode goes wrong when item includes a comma"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-a-list-using-a-shortcode-goes-wrong-when-item-includes-a-comma#post-267578</link>
			<pubDate>Wed, 22 May 2013 05:44:10 +0000</pubDate>
			<dc:creator>Sjoerd</dc:creator>
			<guid isPermaLink="false">267578@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for your reply Alex but I don't think this is a workable solution for my case. &#60;/p&#62;
&#60;p&#62;For each form I've made a page template which loads the filled out form using ajax when clicked on a piece of text (instant/live text editing). Therefor I have no way of knowing which text I have to feed the hook you're suggesting in my functions.php.&#60;/p&#62;
&#60;p&#62;As this only occurs with a comma character I've now fixed it using a simple comma replace in the text before I feed it to the shortcode, and then replace it back to a comma on the page using jquery. Not very pretty but it works.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "populate a list using a shortcode goes wrong when item includes a comma"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-a-list-using-a-shortcode-goes-wrong-when-item-includes-a-comma#post-265849</link>
			<pubDate>Tue, 21 May 2013 12:18:00 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">265849@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yea, this does seem to be a limitation of using the shortcode + a comma delimited list of values. The solution would be to url encode the comma, but the problem is that the shortcode processing from WordPress decodes the string when parsing the shortcode parameters.&#60;br /&#62;
I think the only solution here is to use the gform_field_value_$parameter-name PHP hook to populate the list field (&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name)&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name)&#60;/a&#62;. The following code snippet should do the trick. Place it in your theme's functions.php file.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_field_value_list&#38;quot;, &#38;quot;populate_list&#38;quot;);
function populate_list($value){
   return array(&#38;quot;row 1 - col1&#38;quot;,&#38;quot;row 1 - col2&#38;quot;, &#38;quot;row 1 - col3&#38;quot;,
                &#38;quot;row 2 - col1&#38;quot;, &#38;quot;row 2 - col2&#38;quot;, &#38;quot;row 2 - col3&#38;quot;,
                &#38;quot;row 3 - col1&#38;quot;, &#38;quot;row 3 - col2&#38;quot;, &#38;quot;row 3 - col3&#38;quot;);

}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Sjoerd on "populate a list using a shortcode goes wrong when item includes a comma"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-a-list-using-a-shortcode-goes-wrong-when-item-includes-a-comma#post-257844</link>
			<pubDate>Fri, 17 May 2013 11:42:56 +0000</pubDate>
			<dc:creator>Sjoerd</dc:creator>
			<guid isPermaLink="false">257844@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks David! I'll be awaiting their reply.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "populate a list using a shortcode goes wrong when item includes a comma"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-a-list-using-a-shortcode-goes-wrong-when-item-includes-a-comma#post-257839</link>
			<pubDate>Fri, 17 May 2013 11:40:31 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">257839@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there, I'll let our developers know about this today.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Sjoerd on "populate a list using a shortcode goes wrong when item includes a comma"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-a-list-using-a-shortcode-goes-wrong-when-item-includes-a-comma#post-257256</link>
			<pubDate>Fri, 17 May 2013 05:26:23 +0000</pubDate>
			<dc:creator>Sjoerd</dc:creator>
			<guid isPermaLink="false">257256@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I can't really find where this is handled in the gravity forms code, however my guess is that the comma separated list is first run through urldecode as a whole, and then split into individual items to fill the input fields in the form. &#60;/p&#62;
&#60;p&#62;By first doing the urldecode the comma's in the text are decoded and will be messing things up.&#60;/p&#62;
&#60;p&#62;If this is the case a fix would be easy by just switching the order in the code, first splitting the items and then do the urldecoding per item.&#60;/p&#62;
&#60;p&#62;I hope this helps in some way.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Sjoerd on "populate a list using a shortcode goes wrong when item includes a comma"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-a-list-using-a-shortcode-goes-wrong-when-item-includes-a-comma#post-255299</link>
			<pubDate>Thu, 16 May 2013 06:20:38 +0000</pubDate>
			<dc:creator>Sjoerd</dc:creator>
			<guid isPermaLink="false">255299@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;&#60;code&#62;[gravityforms id=&#38;#39;3&#38;#39; field_values=&#38;#39;title=mytitle&#38;amp;list=only 1 list item, except it has a comma so it&#38;#39;s seen as 2&#38;#39; title=&#38;#39;false&#38;#39;]&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Above example will output my form with two items:&#60;br /&#62;
- only 1 list item&#60;br /&#62;
- except it has a comma so it's seem as 2&#60;/p&#62;
&#60;p&#62;However I want it as 1 item. How?&#60;/p&#62;
&#60;p&#62;The ' in it's was giving a problem as well, however I fixed this using urlencode. Unfortunately this doesn't fix the comma problem
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
