<?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: Creating Dynamic Radio Options Based on Checkboxes Selections Using Javascript</title>
		<link>https://legacy.forums.gravityhelp.com/topic/creating-dynamic-radio-options-based-on-checkboxes-selections-using-javascript</link>
		<description>Gravity Support Forums Topic: Creating Dynamic Radio Options Based on Checkboxes Selections Using Javascript</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 02:52:17 +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/creating-dynamic-radio-options-based-on-checkboxes-selections-using-javascript" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Creating Dynamic Radio Options Based on Checkboxes Selections Using Javascript"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-dynamic-radio-options-based-on-checkboxes-selections-using-javascript#post-78765</link>
			<pubDate>Wed, 03 Oct 2012 17:55:24 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">78765@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can find m4change's contact information on their profile page:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/profile/m4change&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/profile/m4change&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;If you would like help implementing a solution yourself, please let us know.  Please include a URL for the page where your form is embedded.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Fika on "Creating Dynamic Radio Options Based on Checkboxes Selections Using Javascript"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-dynamic-radio-options-based-on-checkboxes-selections-using-javascript#post-78704</link>
			<pubDate>Wed, 03 Oct 2012 14:53:25 +0000</pubDate>
			<dc:creator>Fika</dc:creator>
			<guid isPermaLink="false">78704@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi m4change, code looks like what I might be after.&#60;/p&#62;
&#60;p&#62;I am trying to populate once set of radio buttons based on another set of radio buttons. The radio buttons are in exact same form. &#60;/p&#62;
&#60;p&#62;So let’s say I have 1 set which is&#60;/p&#62;
&#60;p&#62;Radio Buttons 1&#60;br /&#62;
* Red&#60;br /&#62;
* Green&#60;br /&#62;
* Blue&#60;/p&#62;
&#60;p&#62;Radio Buttons 2&#60;br /&#62;
* 1&#60;br /&#62;
* 2&#60;br /&#62;
* 3&#60;/p&#62;
&#60;p&#62;So I would like to do a direct mapping. If a user chooses “red” then “1″ is dynamically chosen in the radio button 2 set and so on. &#60;/p&#62;
&#60;p&#62;Would your code work for this?&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>m4change on "Creating Dynamic Radio Options Based on Checkboxes Selections Using Javascript"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-dynamic-radio-options-based-on-checkboxes-selections-using-javascript#post-16704</link>
			<pubDate>Thu, 20 Jan 2011 13:38:48 +0000</pubDate>
			<dc:creator>m4change</dc:creator>
			<guid isPermaLink="false">16704@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Here's an updated fix that helps protect against options being selected when they aren't available.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;style type=&#38;quot;text/css&#38;quot;&#38;gt;#input_6_8 li { display:none; }&#38;lt;/style&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
jQuery(document).bind(&#38;quot;gform_page_loaded&#38;quot;, function(event, formId, currentPageNumber) {
    var ainputs=[];
    jQuery(&#38;quot;#input_6_2 li input:checkbox&#38;quot;).each(function() { ainputs.push(jQuery(this).is(&#38;quot;:checked&#38;quot;)) });
    if (currentPageNumber==2) {
        //alert(&#38;#39;New page loaded. Page: &#38;#39; + currentPageNumber + &#38;#39;, Form: &#38;#39; + formId + &#38;#39;, inputs: &#38;#39; + ainputs.join(&#38;#39;&#38;quot;, &#38;quot;&#38;#39;));
        jQuery(&#38;quot;#input_6_8 li&#38;quot;).each(function() {
                jQuery(this).hide();
                jQuery(this).children(&#38;quot;input&#38;quot;).attr(&#38;#39;disabled&#38;#39;,true);
        });
        if (ainputs[0]==true) {
                jQuery(&#38;quot;.gchoice_8_0&#38;quot;).fadeIn();
                jQuery(&#38;quot;.gchoice_8_0 input&#38;quot;).removeAttr(&#38;#39;disabled&#38;#39;);
        }
        if (ainputs[1]==true) {
                jQuery(&#38;quot;.gchoice_8_1&#38;quot;).fadeIn();
                jQuery(&#38;quot;.gchoice_8_1 input&#38;quot;).removeAttr(&#38;#39;disabled&#38;#39;);
                jQuery(&#38;quot;.gchoice_8_2&#38;quot;).fadeIn();
                jQuery(&#38;quot;.gchoice_8_2 input&#38;quot;).removeAttr(&#38;#39;disabled&#38;#39;);
        }
        if (ainputs[2]==true) {
                jQuery(&#38;quot;.gchoice_8_3&#38;quot;).fadeIn();
                jQuery(&#38;quot;.gchoice_8_3 input&#38;quot;).removeAttr(&#38;#39;disabled&#38;#39;);
                jQuery(&#38;quot;.gchoice_8_4&#38;quot;).fadeIn();
                jQuery(&#38;quot;.gchoice_8_4 input&#38;quot;).removeAttr(&#38;#39;disabled&#38;#39;);
        }
        if (ainputs[3]==true) {
                jQuery(&#38;quot;.gchoice_8_2&#38;quot;).fadeIn();
                jQuery(&#38;quot;.gchoice_8_2 input&#38;quot;).removeAttr(&#38;#39;disabled&#38;#39;);
                jQuery(&#38;quot;.gchoice_8_4&#38;quot;).fadeIn();
                jQuery(&#38;quot;.gchoice_8_4 input&#38;quot;).removeAttr(&#38;#39;disabled&#38;#39;);
                jQuery(&#38;quot;.gchoice_8_5&#38;quot;).fadeIn();
                jQuery(&#38;quot;.gchoice_8_5 input&#38;quot;).removeAttr(&#38;#39;disabled&#38;#39;);
        }
    }
});
&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>m4change on "Creating Dynamic Radio Options Based on Checkboxes Selections Using Javascript"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-dynamic-radio-options-based-on-checkboxes-selections-using-javascript#post-16694</link>
			<pubDate>Thu, 20 Jan 2011 11:44:17 +0000</pubDate>
			<dc:creator>m4change</dc:creator>
			<guid isPermaLink="false">16694@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I didn't find the PHP solutions sufficient for my needs.  I crafted an example of how to go about creating dynamic radio button options using javascript by binding to the gform_page_loaded hook and gathering the values of checkboxes from a previous step.&#60;/p&#62;
&#60;p&#62;There is something to note about this hook, I'm not sure if it's considered a bug or not.  The hook will still fire if you click &#34;next&#34; or &#34;previous&#34; even if validation fails and keeps you on that page.  In my case, where I'm using javascript to hide radio buttons, this doesn't really matter but I thought the gforms devs might want to know, if they weren't aware.&#60;/p&#62;
&#60;p&#62;For this example, I'm using a form with the id of 6.  I'm using checkboxes on page 1 (input_6_2) to reformat a multiple choice list on page 2 by hiding all the radio buttons, then showing only specific ones based on the values of the checkboxes. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
jQuery(document).bind(&#38;quot;gform_page_loaded&#38;quot;, function(event, formId, currentPageNumber) {
    var ainputs=[];
    jQuery(&#38;quot;#input_6_2 li input:checkbox&#38;quot;).each(function() { ainputs.push(jQuery(this).is(&#38;quot;:checked&#38;quot;)) });
    if (currentPageNumber==2) {
        //alert(&#38;#39;New page loaded. Page: &#38;#39; + currentPageNumber + &#38;#39;, Form: &#38;#39; + formId + &#38;#39;, inputs: &#38;#39; + ainputs.join(&#38;#39;&#38;quot;, &#38;quot;&#38;#39;));
        jQuery(&#38;quot;#input_6_8 li&#38;quot;).hide();
        if (ainputs[0]==true) {
                jQuery(&#38;quot;.gchoice_8_0&#38;quot;).show();
        }
        if (ainputs[1]==true) {
                jQuery(&#38;quot;.gchoice_8_1&#38;quot;).show();
                jQuery(&#38;quot;.gchoice_8_2&#38;quot;).show();
        }
        if (ainputs[2]==true) {
                jQuery(&#38;quot;.gchoice_8_3&#38;quot;).show();
                jQuery(&#38;quot;.gchoice_8_4&#38;quot;).show();
        }
        if (ainputs[3]==true) {
                jQuery(&#38;quot;.gchoice_8_2&#38;quot;).show();
                jQuery(&#38;quot;.gchoice_8_4&#38;quot;).show();
                jQuery(&#38;quot;.gchoice_8_5&#38;quot;).show();
        }
    }
});
&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This is just a bare proof of concept, you'll want to do some additional checks to ensure your users aren't passing impossible values (values from now hidden multiple choice selections).  I found this solution to be more flexible than the PHP &#34;solution&#34; for a project I'm currently working on.&#60;/p&#62;
&#60;p&#62;I hope these notes help others looking to implement something similar.  Maybe the devs have a few comments about it.&#60;/p&#62;
&#60;p&#62;P.S. I noticed some inconsistency in the identification and classification of inputs (using classes instead of ids in some cases) and I'm unsure as to why you guys don't use arrays for checkboxes and radio buttons.  I was able to work around this but it wasn't without a little critical thinking.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
