<?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: Argh - gform_pre_render again</title>
		<link>https://legacy.forums.gravityhelp.com/topic/argh-gform_pre_render-again</link>
		<description>Gravity Support Forums Topic: Argh - gform_pre_render again</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 19:08:57 +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/argh-gform_pre_render-again" rel="self" type="application/rss+xml" />

		<item>
			<title>dochara on "Argh - gform_pre_render again"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/argh-gform_pre_render-again#post-46524</link>
			<pubDate>Mon, 16 Jan 2012 19:59:00 +0000</pubDate>
			<dc:creator>dochara</dc:creator>
			<guid isPermaLink="false">46524@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I figured it out. It requires a two step process:&#60;/p&#62;
&#60;p&#62;1. Unset the field using gform_pre_render if it is not needed&#60;br /&#62;
2. Validate it using  if it is needed&#60;/p&#62;
&#60;p&#62;I've posted my code here for anyone who is interested.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastebin.com/pQ4TCTzh&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/pQ4TCTzh&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dochara on "Argh - gform_pre_render again"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/argh-gform_pre_render-again#post-46504</link>
			<pubDate>Mon, 16 Jan 2012 17:21:47 +0000</pubDate>
			<dc:creator>dochara</dc:creator>
			<guid isPermaLink="false">46504@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You may want to merge this into my previous thread, as I thought I'd solved it, but haven't :(&#60;/p&#62;
&#60;p&#62;Problem arises when unsetting a required field - it's still required. So, I need something extra here, but not sure what.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function sd_hide_or_require_insured($form){
	$insuredfield = array(&#38;#39;Insured&#38;#39;);
	global $post;
	$needsinsurance = get_post_meta($post-&#38;gt;ID,&#38;#39;_sd_prod_insurance&#38;#39;,true);
	if ($needsinsurance==1) {
		//make the field required  - but how?
	} else {
		foreach($form[&#38;#39;fields&#38;#39;] as $key=&#38;gt;$field) {
			if(in_array($field[&#38;#39;label&#38;#39;], $insuredfield)) {
				unset($form[&#38;#39;fields&#38;#39;][$key]);
//or alternatively make it not required if value is 0,  as well as unsetting
			}
		}
	}
    return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Any help really appreciated.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
