<?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: Problem while setting a field as required / not-required using gform_pre_render</title>
		<link>https://legacy.forums.gravityhelp.com/topic/problem-while-setting-a-field-as-required-not-required-using-gform_pre_render</link>
		<description>Gravity Support Forums Topic: Problem while setting a field as required / not-required using gform_pre_render</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 12:21:24 +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/problem-while-setting-a-field-as-required-not-required-using-gform_pre_render" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Problem while setting a field as required / not-required using gform_pre_render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/problem-while-setting-a-field-as-required-not-required-using-gform_pre_render#post-36373</link>
			<pubDate>Tue, 27 Sep 2011 14:35:19 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">36373@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If it works, I don't think you're hurting anything doing it like this.  What has your experience been so far?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>remotecontroldesign on "Problem while setting a field as required / not-required using gform_pre_render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/problem-while-setting-a-field-as-required-not-required-using-gform_pre_render#post-36193</link>
			<pubDate>Mon, 26 Sep 2011 02:18:20 +0000</pubDate>
			<dc:creator>remotecontroldesign</dc:creator>
			<guid isPermaLink="false">36193@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Chris,&#60;br /&#62;
Thanks for the response!&#60;br /&#62;
Yes, it worked !&#60;br /&#62;
Just tell me if this is the right way:&#60;br /&#62;
I made an array with the inputNames of only those fields which are required when the current user is admin. Then in the 'gform_validation' filter, I looped through the fields, checked whether the current user is admin and if the field's inputName is in the above array, just set its 'failed_validation' property to false, and 'is_valid' property to true.&#60;br /&#62;
Is this okay? Do I need to set 'isRequired' to false again, as I'm doing it already in pre_render?&#60;br /&#62;
I just don't want anything to go wrong with the form meta or something, hence being sure!&#60;/p&#62;
&#60;p&#62;- Rutwick
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Problem while setting a field as required / not-required using gform_pre_render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/problem-while-setting-a-field-as-required-not-required-using-gform_pre_render#post-36136</link>
			<pubDate>Sat, 24 Sep 2011 13:40:48 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">36136@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In addition to the gform_pre_render, you need to take care of validation.&#60;/p&#62;
&#60;p&#62;This was talking about something different, but the process is the same.  There are two parts to it:  the pre_render and the validation:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/ensure-required-box-is-ticked-by-default#post-35416&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/ensure-required-box-is-ticked-by-default#post-35416&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Please see if that helps get you going in the correct direction.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>remotecontroldesign on "Problem while setting a field as required / not-required using gform_pre_render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/problem-while-setting-a-field-as-required-not-required-using-gform_pre_render#post-36111</link>
			<pubDate>Sat, 24 Sep 2011 03:15:48 +0000</pubDate>
			<dc:creator>remotecontroldesign</dc:creator>
			<guid isPermaLink="false">36111@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I'm using 'gform_pre_render' to do a lot of stuff on my forms. This is what I'm trying to achieve:&#60;/p&#62;
&#60;p&#62;I have 20 fields (all set as required from back-end). I want to set only the first 5 fields as 'required' when the current user is administrator, and keep all of them required if the current user has some other custom role that I defined. Using the filter, I check the current_user_can('role') and set the 'isRequired' property as 1 or blank according to the role.&#60;/p&#62;
&#60;p&#62;In the front end, when the form is rendered, I can see the asterisks disappeared for the fields I set as not-required through my code ( by setting 'isRequired' as blank ), but when I submit the form with them as empty, they still fail the validation and my form doesn't get submitted!&#60;br /&#62;
Is there any other parameter from the field object I need to disable? Please help me with this.&#60;/p&#62;
&#60;p&#62;Thanks in advance!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
