<?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: read only input fields</title>
		<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields</link>
		<description>Gravity Support Forums Topic: read only input fields</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:18:32 +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/read-only-input-fields" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-145001</link>
			<pubDate>Sat, 09 Feb 2013 01:42:05 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">145001@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for that tip Drew.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Drew M. Turner on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-144556</link>
			<pubDate>Fri, 08 Feb 2013 03:47:45 +0000</pubDate>
			<dc:creator>Drew M. Turner</dc:creator>
			<guid isPermaLink="false">144556@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Just want to suggest using a switch to designate which form is to be use.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;switch($form[&#38;#39;id&#38;#39;])
{
     case 2:     Code here for Form 2
                      break;
     case 3:     Code here for Form 3
                      break;
     case 6:     Code here for Form 6
                      break;
     case 7:     Code here for Form 7
                      break;
     case 22:     Code here for Form 22
                      break;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;It works well for Field IDs also.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-106564</link>
			<pubDate>Sun, 23 Dec 2012 19:00:48 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">106564@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Your logic is correct, but the IF statement goes inside of the function call. Basically, the if statement is saying if it isn't one of these then just exit and return the form normally, otherwise, continue to the lines below...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>lindebjerg on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-106472</link>
			<pubDate>Sun, 23 Dec 2012 12:53:12 +0000</pubDate>
			<dc:creator>lindebjerg</dc:creator>
			<guid isPermaLink="false">106472@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I would like to ad this to five forms with following id´s: 2, 3, 6, 7 and 22
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-106443</link>
			<pubDate>Sun, 23 Dec 2012 11:44:55 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">106443@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Which forms are you trying to apply this to?  My guess is that your logic is wrong in line 03 above.  In plain language, not code, can you state on which form(s) you want this to apply?&#60;/p&#62;
&#60;p&#62;In the above, you are basically saying, &#34;if form does not equal 2, or form does not equal 3 ...&#34; - which will return the form, right off the bat, since form 2 does not equal form 3, and you have an OR condition (&#124;&#124;).  You will have to rewrite that statement.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>lindebjerg on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-106437</link>
			<pubDate>Sun, 23 Dec 2012 11:01:09 +0000</pubDate>
			<dc:creator>lindebjerg</dc:creator>
			<guid isPermaLink="false">106437@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have no idear of php, so please point out my mistakes? it does not work with more than one form :(&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;// Gravity Form Read only Input Fields - use ID of your form
add_filter(&#38;#39;gform_pre_render&#38;#39;, &#38;#39;add_readonly_script&#38;#39;);
if($form[&#38;quot;id&#38;quot;] != 2 &#124;&#124; $form[&#38;quot;id&#38;quot;] != 3 &#124;&#124; $form[&#38;quot;id&#38;quot;] != 6 &#124;&#124; $form[&#38;quot;id&#38;quot;] != 7 &#124;&#124; $form[&#38;quot;id&#38;quot;] != 22 )
	       return $form;
function add_readonly_script($form){
    ?&#38;gt;

    &#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
        jQuery(document).ready(function(){
            jQuery(&#38;quot;li.gf_readonly input&#38;quot;).attr(&#38;quot;readonly&#38;quot;,&#38;quot;readonly&#38;quot;);
        });
    &#38;lt;/script&#38;gt;

    &#38;lt;?php
    return $form;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Peralty on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-105391</link>
			<pubDate>Fri, 21 Dec 2012 11:33:15 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">105391@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;First you take out the form qualification in the filter:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_pre_render&#38;#39;, &#38;#39;add_readonly_script&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then you test against ID's:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if($form[&#38;quot;id&#38;quot;] != 2 &#124;&#124; $form[&#38;quot;id&#38;quot;] != 3 )
       return $form;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Does that help?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>lindebjerg on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-105388</link>
			<pubDate>Fri, 21 Dec 2012 11:25:22 +0000</pubDate>
			<dc:creator>lindebjerg</dc:creator>
			<guid isPermaLink="false">105388@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62;you can test for the form ID and apply the same function to multiple form ID's.&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;How can I apply more form ID´s to one function? Can I write more filters and then the function? or how does it work...&#60;br /&#62;
add_filter('gform_pre_render_2', 'add_readonly_script');&#60;br /&#62;
add_filter('gform_pre_render_6', 'add_readonly_script');
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-105362</link>
			<pubDate>Fri, 21 Dec 2012 10:18:54 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">105362@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If you want to use it multiple times, you need to change the function name as the function needs to be unique. Or you can test for the form ID and apply the same function to multiple form ID's.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>lindebjerg on "read only input fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/read-only-input-fields#post-105324</link>
			<pubDate>Fri, 21 Dec 2012 07:03:58 +0000</pubDate>
			<dc:creator>lindebjerg</dc:creator>
			<guid isPermaLink="false">105324@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I use this &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/terms-and-conditions-text-record-in-form-entries-database#post-25225&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/terms-and-conditions-text-record-in-form-entries-database#post-25225&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;here: &#60;a href=&#34;http://hardthaus.de/feinschmeckertermine/wintergemuse-und-beilagen-kochkurs/&#34; rel=&#34;nofollow&#34;&#62;http://hardthaus.de/feinschmeckertermine/wintergemuse-und-beilagen-kochkurs/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;but I have more forms on this site where I would like to use this function... I tried to ad the code 2 times changing the ID of the form, but then I got an error? how must I write the code to have this function on more form?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
