<?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: Bug: gform_pre_render &#62; isRequired does not work for fileupload fields</title>
		<link>https://legacy.forums.gravityhelp.com/topic/bug-gform_pre_render-isrequired-does-not-work-for-fileupload-fields</link>
		<description>Gravity Support Forums Topic: Bug: gform_pre_render &gt; isRequired does not work for fileupload fields</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 02:07:51 +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/bug-gform_pre_render-isrequired-does-not-work-for-fileupload-fields" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "Bug: gform_pre_render &#62; isRequired does not work for fileupload fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/bug-gform_pre_render-isrequired-does-not-work-for-fileupload-fields#post-38877</link>
			<pubDate>Tue, 25 Oct 2011 10:12:49 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">38877@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I will be glad to help. Is this a multi-page or a single-page form? If it is a multi-page form, it would be helpful if you exported the form (Forms-&#38;gt;Import/Export-&#38;gt;Export form) and pasted a link to the exported XML file.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dotcom on "Bug: gform_pre_render &#62; isRequired does not work for fileupload fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/bug-gform_pre_render-isrequired-does-not-work-for-fileupload-fields#post-38814</link>
			<pubDate>Mon, 24 Oct 2011 19:46:31 +0000</pubDate>
			<dc:creator>dotcom</dc:creator>
			<guid isPermaLink="false">38814@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you Alex for the superb reply.&#60;/p&#62;
&#60;p&#62;We're using v1.5.2.8 - as we have done extensive customisations the upgrade is in the pipeline but not possible at the minute.&#60;/p&#62;
&#60;p&#62;Have attempted to write the function using Gform_validation but really struggling: &#60;a href=&#34;http://www.pastie.org/private/lfr5pyunl9acted3bpocw&#34; rel=&#34;nofollow&#34;&#62;http://www.pastie.org/private/lfr5pyunl9acted3bpocw&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Could you help me out with this?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Bug: gform_pre_render &#62; isRequired does not work for fileupload fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/bug-gform_pre_render-isrequired-does-not-work-for-fileupload-fields#post-38750</link>
			<pubDate>Mon, 24 Oct 2011 12:08:25 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">38750@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The problem is that the gform_pre_render fires after the form validation takes place, so you can't use it to change the validation behavior. I wouldn't call it a bug, but I do agree that not being able to mark a field as required in that filter is counter-intuitive. I will be looking at ways to improve this.&#60;br /&#62;
For now, you can use a combination of the gform_pre_render filter and the gform_field_validation filter to accomplish what you need. Following is a code snippet.&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/2751185&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/2751185&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Note that gform_field_validation is new in 1.6. If you are not using that version and do not want to upgrade, you will need to use the gform_validation filter. Following is it's documentation.&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_validation&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_validation&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Bug: gform_pre_render &#62; isRequired does not work for fileupload fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/bug-gform_pre_render-isrequired-does-not-work-for-fileupload-fields#post-38730</link>
			<pubDate>Mon, 24 Oct 2011 11:16:55 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">38730@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Which version of the plugin are you using?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dotcom on "Bug: gform_pre_render &#62; isRequired does not work for fileupload fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/bug-gform_pre_render-isrequired-does-not-work-for-fileupload-fields#post-38686</link>
			<pubDate>Sun, 23 Oct 2011 13:30:09 +0000</pubDate>
			<dc:creator>dotcom</dc:creator>
			<guid isPermaLink="false">38686@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Gravity forms is unable to modify the required status of a fileupload field.&#60;/p&#62;
&#60;p&#62;Test A:&#60;br /&#62;
All fileupload fields were set to required in the form editor. The pre_render was user to set all fileuploads to:&#60;br /&#62;
$field['isRequired'] = 0;&#60;/p&#62;
&#60;p&#62;result &#38;gt; the fields were still required&#60;/p&#62;
&#60;p&#62;Test B:&#60;br /&#62;
All fileupload fields were set to default (un-required) in the form editor. The pre_render was user to set all fileuploads to:&#60;br /&#62;
$field['isRequired'] = 1;&#60;/p&#62;
&#60;p&#62;result &#38;gt; the fields were still not required (Although an asterisk did appear on the form).&#60;/p&#62;
&#60;p&#62;Sample code:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;quot;gform_pre_render&#38;quot;, &#38;#39;gfpr_populate_by_lead&#38;#39; );
function gfpr_populate_by_lead( $form ) {

    foreach ( $form[&#38;#39;fields&#38;#39;] as &#38;amp;$field ) {

        switch ( $field[&#38;#39;type&#38;#39;] ) {

        case &#38;#39;fileupload&#38;#39;:

		$field[&#38;#39;isRequired&#38;#39;] = 1;

            break;

        default:

    }

return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Could you confirm this bug? Perhaps there is an alternative function to achieve the same result?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
