<?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: Prepopulated post_category selector and isSelected fails</title>
		<link>https://legacy.forums.gravityhelp.com/topic/prepopulated-post_category-selector-and-isselected-fails</link>
		<description>Gravity Support Forums Topic: Prepopulated post_category selector and isSelected fails</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 02:36:48 +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/prepopulated-post_category-selector-and-isselected-fails" rel="self" type="application/rss+xml" />

		<item>
			<title>Carl Hancock on "Prepopulated post_category selector and isSelected fails"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prepopulated-post_category-selector-and-isselected-fails#post-3619</link>
			<pubDate>Thu, 25 Feb 2010 19:06:40 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">3619@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Your solution is fine, we will get this added in the next release so that going forward it takes the value into account.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Prepopulated post_category selector and isSelected fails"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prepopulated-post_category-selector-and-isselected-fails#post-3615</link>
			<pubDate>Thu, 25 Feb 2010 13:01:15 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">3615@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Bart, i'll have our lead developer check this out and post a response shortly.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bartv2 on "Prepopulated post_category selector and isSelected fails"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prepopulated-post_category-selector-and-isselected-fails#post-3604</link>
			<pubDate>Thu, 25 Feb 2010 11:45:05 +0000</pubDate>
			<dc:creator>bartv2</dc:creator>
			<guid isPermaLink="false">3604@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've prepopulated a post_category field with a bunch of values that I retrieved from the database. Unlike regular drop-down fields, a category drop-down is a real key-value pair (category-id =&#38;gt; category name).&#60;/p&#62;
&#60;p&#62;The get_select_choices method in common.php doesn't seem to handle this correctly: the way it is set up now it'll ignore the isSelected value is there is an incoming value (which works, but confused the heck out of me as I was trying to insert an isSelected field).&#60;/p&#62;
&#60;p&#62;Next, the code checks to see if the incoming value matches the option label:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;$selected = ($value == $choice[&#38;quot;text&#38;quot;]) ? &#38;quot;selected=&#38;#39;selected&#38;#39;&#38;quot; : &#38;quot;&#38;quot;;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;For common drop-down fields this is fine as the value is equal to the text, but for categories this fails as the option's value is different from the label. I believe the code should read:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#38;#39;$selected = ($value == $choice[&#38;quot;value&#38;quot;]) ? &#38;quot;selected=&#38;#39;selected&#38;#39;&#38;quot; : &#38;quot;&#38;quot;;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;It works for me. Can you confirm my solution and if so, include it in the next release? &#60;/p&#62;
&#60;p&#62;Thanks!&#60;/p&#62;
&#60;p&#62;Bart
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
