<?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: pre checking radio button on form render</title>
		<link>https://legacy.forums.gravityhelp.com/topic/pre-checking-radio-button-on-form-render</link>
		<description>Gravity Support Forums Topic: pre checking radio button on form render</description>
		<language>en-US</language>
		<pubDate>Thu, 23 Apr 2026 07:10:32 +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/pre-checking-radio-button-on-form-render" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "pre checking radio button on form render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-checking-radio-button-on-form-render#post-42856</link>
			<pubDate>Fri, 02 Dec 2011 07:34:04 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">42856@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Glad to help. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>adomedia on "pre checking radio button on form render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-checking-radio-button-on-form-render#post-42854</link>
			<pubDate>Fri, 02 Dec 2011 05:18:34 +0000</pubDate>
			<dc:creator>adomedia</dc:creator>
			<guid isPermaLink="false">42854@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Awesome, works a treat, thanks David!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "pre checking radio button on form render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-checking-radio-button-on-form-render#post-42776</link>
			<pubDate>Thu, 01 Dec 2011 17:09:24 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">42776@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Tom,&#60;/p&#62;
&#60;p&#62;You should be able to add an &#34;isSelected&#34; property to the choices array, like so:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
$choices[] = array(&#38;quot;text&#38;quot; =&#38;gt; &#38;quot;None&#38;quot;, &#38;quot;value&#38;quot; =&#38;gt; &#38;quot;None&#38;quot;, &#38;quot;isSelected&#38;quot; =&#38;gt; true);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Let me know if that does the trick.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>adomedia on "pre checking radio button on form render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-checking-radio-button-on-form-render#post-42719</link>
			<pubDate>Thu, 01 Dec 2011 07:59:09 +0000</pubDate>
			<dc:creator>adomedia</dc:creator>
			<guid isPermaLink="false">42719@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there,&#60;/p&#62;
&#60;p&#62;I've written the below based on one of your code solutions on another post and it works brilliantly. However I would like to know how to make the &#34;None&#34; radio button &#34;checked&#34; when the form renders.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
add_filter(&#38;quot;gform_pre_render_20&#38;quot;, &#38;quot;populate_radios&#38;quot;);

function populate_radios($form){
	global $post;
	$fieldstochange = array(33,35,36,37,38,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88);
	foreach ($fieldstochange as $fieldtochange) {
    //Creating choices
    $choices = array();
    			if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option1&#38;#39;,true)) {
                    $choices[] = array(&#38;quot;text&#38;quot; =&#38;gt; &#38;quot;Option 1&#38;quot;, &#38;quot;value&#38;quot; =&#38;gt; &#38;quot;Option 1&#124;10&#38;quot;);
                }
                 if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option2&#38;#39;,true)) {
                   $choices[] = array(&#38;quot;text&#38;quot; =&#38;gt; &#38;quot;Option 2&#38;quot;, &#38;quot;value&#38;quot; =&#38;gt; &#38;quot;Option 2&#124;10&#38;quot;);
                }
                 if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option3&#38;#39;,true)) {
                    $choices[] = array(&#38;quot;text&#38;quot; =&#38;gt; &#38;quot;Option 3&#38;quot;, &#38;quot;value&#38;quot; =&#38;gt; &#38;quot;Option 3&#124;10&#38;quot;);
                 }
                  if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option4&#38;#39;,true)) {
                    $choices[] = array(&#38;quot;text&#38;quot; =&#38;gt; &#38;quot;Option 4&#38;quot;, &#38;quot;value&#38;quot; =&#38;gt; &#38;quot;Option 4&#124;10&#38;quot;);
                 }
                  if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option5&#38;#39;,true)) {
                    $choices[] = array(&#38;quot;text&#38;quot; =&#38;gt; &#38;quot;Option 5&#38;quot;, &#38;quot;value&#38;quot; =&#38;gt; &#38;quot;Option 5&#124;10&#38;quot;);
                 }
                    $choices[] = array(&#38;quot;text&#38;quot; =&#38;gt; &#38;quot;None&#38;quot;, &#38;quot;value&#38;quot; =&#38;gt; &#38;quot;None&#38;quot;);

    $inputs = array();
    			 if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option1&#38;#39;,true)) {
                    $inputs[] = array(&#38;quot;label&#38;quot; =&#38;gt; &#38;quot;Option 1&#38;quot;, &#38;quot;id&#38;quot; =&#38;gt; $fieldtochange.&#38;#39;.1&#38;#39;);
                 }
                  if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option1&#38;#39;,true)) {
                    $inputs[] = array(&#38;quot;label&#38;quot; =&#38;gt; &#38;quot;Option 2&#38;quot;, &#38;quot;id&#38;quot; =&#38;gt; $fieldtochange.&#38;#39;.2&#38;#39;);
                 }
                  if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option1&#38;#39;,true)) {
                    $inputs[] = array(&#38;quot;label&#38;quot; =&#38;gt; &#38;quot;Option 3&#38;quot;, &#38;quot;id&#38;quot; =&#38;gt; $fieldtochange.&#38;#39;.3&#38;#39;);
                 }
                  if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option1&#38;#39;,true)) {
                   $inputs[] = array(&#38;quot;label&#38;quot; =&#38;gt; &#38;quot;Option 4&#38;quot;, &#38;quot;id&#38;quot; =&#38;gt; $fieldtochange.&#38;#39;.4&#38;#39;);
                 }
                  if(get_post_meta($post-&#38;gt;ID,&#38;#39;ecpt_option1&#38;#39;,true)) {
                    $inputs[] = array(&#38;quot;label&#38;quot; =&#38;gt; &#38;quot;Option 5&#38;quot;, &#38;quot;id&#38;quot; =&#38;gt; $fieldtochange.&#38;#39;.5&#38;#39;);
                 }
                    $inputs[] = array(&#38;quot;label&#38;quot; =&#38;gt; &#38;quot;None&#38;quot;, &#38;quot;id&#38;quot; =&#38;gt; $fieldtochange.&#38;#39;.6&#38;#39;);

    //Adding items to field id 8. Replace 8 with your actual field id. You can get the field id by looking at the input name in the markup.
    foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){
        //replace 2 with your checkbox field id
        if($field[&#38;quot;id&#38;quot;] == $fieldtochange){
            $field[&#38;quot;choices&#38;quot;] = $choices;
            $field[&#38;quot;inputs&#38;quot;] = $inputs;
        }
    }
}
    return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;thanks in advance!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
