<?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: Can I specify Default Choice in Shortcode</title>
		<link>https://legacy.forums.gravityhelp.com/topic/can-i-specify-default-choice-in-shortcode</link>
		<description>Gravity Support Forums Topic: Can I specify Default Choice in Shortcode</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 11:32:11 +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/can-i-specify-default-choice-in-shortcode" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Can I specify Default Choice in Shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-i-specify-default-choice-in-shortcode#post-33225</link>
			<pubDate>Mon, 22 Aug 2011 16:03:06 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">33225@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have this worked out using the &#60;strong&#62;gform_pre_render&#60;/strong&#62; hook.  We need a way to match the page the form is displayed on to the default &#34;selected&#34; value. It could even be a custom field key and value, where the value is the select item to be the default.  If you're not already using a custom field that could be utilized for this purpose, it could be a key of &#34;defaultselect&#34; (or whatever you want it to be) and then a value that is the number in the select list that should be selected.  Each page would have to have this custom field key and value.&#60;/p&#62;
&#60;p&#62;If you go that route, the array is zero based, so the first select item is 0, second one is 1, etc.  For 50 hotels, you'd have values from 0 to 49.  For example, with states alphabetical:&#60;/p&#62;
&#60;p&#62;[0] Alabama&#60;br /&#62;
[1] Alaska&#60;br /&#62;
[2] Arizona&#60;br /&#62;
[3] Arkansas&#60;br /&#62;
[4] California&#60;br /&#62;
[5] Colorado&#60;br /&#62;
[6] Connecticut&#60;br /&#62;
[7] Delaware
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Can I specify Default Choice in Shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-i-specify-default-choice-in-shortcode#post-33223</link>
			<pubDate>Mon, 22 Aug 2011 15:39:23 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">33223@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;To answer the initial question though, I don't think you can using the shortcode.  It will either be a jQuery solution or use a hook to change the &#34;selected&#34; value before the form is displayed.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Field_Object&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Field_Object&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Can I specify Default Choice in Shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-i-specify-default-choice-in-shortcode#post-33222</link>
			<pubDate>Mon, 22 Aug 2011 15:19:39 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">33222@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is a really good question.  &#60;/p&#62;
&#60;p&#62;Doing it all with one form is definitely the way to do it.  You're OK with editing the shortcode in each of 50 pages to set the default for that particular page?&#60;/p&#62;
&#60;p&#62;Did you insert the shortcode into each page already, or can you insert the form into each page in the template using the function call?&#60;/p&#62;
&#60;p&#62;Are there any custom fields or anything else to work with, where we would know which select value to have selected as default, based on that page it's embedded in?  I'm thinking of a custom field like &#34;hotelcity&#34; or something, and then the value is &#34;Chicago&#34;.  Based on that, we set the &#34;selected&#34; value in the select box as &#34;Chicago&#34;.  &#60;/p&#62;
&#60;p&#62;I think it would be easier to do this programatically than manually by editing the shortcode for each page, which is why I asked about the custom fields.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mattswan on "Can I specify Default Choice in Shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-i-specify-default-choice-in-shortcode#post-33177</link>
			<pubDate>Mon, 22 Aug 2011 02:02:56 +0000</pubDate>
			<dc:creator>mattswan</dc:creator>
			<guid isPermaLink="false">33177@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have a single form that is used on many pages across a site.&#60;/p&#62;
&#60;p&#62;The form contains a drop down field with around 50 options in it (it's a listing of towns and cities where we have hotels) and I'd like to ask if it might be possible to specify which of those options displays by default on each page by editing the shortcode that calls the form?&#60;/p&#62;
&#60;p&#62;I'd rather not have to make 50 forms, each with the correct location defined as the default choice.&#60;/p&#62;
&#60;p&#62;Any help much appreciated.&#60;br /&#62;
m@
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
