<?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: Dynamic Creating Conditional Logic</title>
		<link>https://legacy.forums.gravityhelp.com/topic/dynamic-creating-conditional-logic</link>
		<description>Gravity Support Forums Topic: Dynamic Creating Conditional Logic</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 22:03:10 +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/dynamic-creating-conditional-logic" rel="self" type="application/rss+xml" />

		<item>
			<title>Pete on "Dynamic Creating Conditional Logic"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamic-creating-conditional-logic#post-46256</link>
			<pubDate>Thu, 12 Jan 2012 18:58:49 +0000</pubDate>
			<dc:creator>Pete</dc:creator>
			<guid isPermaLink="false">46256@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Ben.&#60;/p&#62;
&#60;p&#62;This is exactly what i am looking for.&#60;br /&#62;
I´m a php and sql beginner, so is it possible for you to show me what you have done to achieve this - like how do the code you put in the function.php look like.&#60;/p&#62;
&#60;p&#62;Thanks&#60;br /&#62;
Peter
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bazchas on "Dynamic Creating Conditional Logic"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamic-creating-conditional-logic#post-46123</link>
			<pubDate>Wed, 11 Jan 2012 10:43:31 +0000</pubDate>
			<dc:creator>bazchas</dc:creator>
			<guid isPermaLink="false">46123@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I worked it out and put it in a generic function to use.&#60;/p&#62;
&#60;p&#62;$rules = array();&#60;br /&#62;
for($i = 0; $i&#38;lt;count($showarray); $i++)&#60;br /&#62;
{&#60;br /&#62;
    $value = $showarray[$i];&#60;br /&#62;
    if($value!=null)&#60;br /&#62;
        $rules[] = array('fieldId' =&#38;gt; $fieldid, 'operator' =&#38;gt; 'is', 'value'=&#38;gt;$value);&#60;br /&#62;
}&#60;br /&#62;
$field['conditionalLogic'] = array('actionType' =&#38;gt; 'show','logicType' =&#38;gt; 'any','rules' =&#38;gt; $rules);&#60;/p&#62;
&#60;p&#62;Pretty basic, the $showarray holds an array of text items that the 'fieldId' ($fieldid) can be to show the field.   I have written a similar function to hide as well, but I think there is an issue with GravityForms.  I set the $field up with the property of being required and I expected this to be ignored when the field was hidden just as when you add conditional logic using the UI.  However when I add the conditional logic dynamically as above the fields are hidden as expected but when the form is submitted it can't be because a hidden field from the conditional logic is halting the operation because of the required property of it.&#60;/p&#62;
&#60;p&#62;If this a bug, or is there another way of setting the conditional logic dynamically on required fields so it works correctly?&#60;/p&#62;
&#60;p&#62;Regards  &#60;/p&#62;
&#60;p&#62;Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bazchas on "Dynamic Creating Conditional Logic"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamic-creating-conditional-logic#post-45959</link>
			<pubDate>Tue, 10 Jan 2012 12:23:55 +0000</pubDate>
			<dc:creator>bazchas</dc:creator>
			<guid isPermaLink="false">45959@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've created a drop list and populated it dynamically using it's Choices from a set of data we hold in our database.  I have a couple of fields that I want to hide or show based on the drop down list values so I need to dynamically create conditional logic for this.  Can you post a example of this in action please.  I've used the conditional logic before using the form designer, but now i need to create that myself within the form.&#60;/p&#62;
&#60;p&#62;Regards&#60;/p&#62;
&#60;p&#62;Ben
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
