<?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: Prepopulated, disabled fields empty when validation fails</title>
		<link>https://legacy.forums.gravityhelp.com/topic/prepopulated-disabled-fields-empty-when-validation-fails</link>
		<description>Gravity Support Forums Topic: Prepopulated, disabled fields empty when validation fails</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 08:29:16 +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/prepopulated-disabled-fields-empty-when-validation-fails" rel="self" type="application/rss+xml" />

		<item>
			<title>usableweb on "Prepopulated, disabled fields empty when validation fails"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prepopulated-disabled-fields-empty-when-validation-fails#post-91122</link>
			<pubDate>Wed, 14 Nov 2012 12:32:23 +0000</pubDate>
			<dc:creator>usableweb</dc:creator>
			<guid isPermaLink="false">91122@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks a bunch - this worked great!  I 'namespaced' the class name a bit to reduce the possibility of collision with other core/plugin CSS.  For those searchers who are interested in the full/final fix:&#60;/p&#62;
&#60;p&#62;1) Inserted the following snippet in header.php between wp_head() call and closing head tag:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
   jQuery(document).ready(function($){
      $(&#38;quot;.gform_wrapper .gf_readonly input&#38;quot;).prop(&#38;#39;readonly&#38;#39;,true);
   });
&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;2) Then for prepopulated fields that are 'read only', on the Advanced tab, add the following CSS Class Name:  gf_readonly&#60;/p&#62;
&#60;p&#62;Thanks Alex!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Prepopulated, disabled fields empty when validation fails"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prepopulated-disabled-fields-empty-when-validation-fails#post-90725</link>
			<pubDate>Tue, 13 Nov 2012 11:55:30 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">90725@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;When you disable an input, its value doesn't get posted with a form submission. That is why it is not retaining its value. Instead of marking it disabled, try marking it as read-only.&#60;br /&#62;
Use the following snippet instead.&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/5372225&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/5372225&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Prepopulated, disabled fields empty when validation fails"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prepopulated-disabled-fields-empty-when-validation-fails#post-90484</link>
			<pubDate>Tue, 13 Nov 2012 00:40:27 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">90484@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm sorry your question was overlooked.  I sent this off to the development team for their feedback.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>usableweb on "Prepopulated, disabled fields empty when validation fails"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prepopulated-disabled-fields-empty-when-validation-fails#post-86415</link>
			<pubDate>Thu, 01 Nov 2012 22:57:32 +0000</pubDate>
			<dc:creator>usableweb</dc:creator>
			<guid isPermaLink="false">86415@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Greetings!  I'm prepopulating a couple fields using the add_filter method described here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Allow_field_to_be_populated_dynamically&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Allow_field_to_be_populated_dynamically&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I was also using this technique to disable input:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/make-a-readonly-field#post-7034&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/make-a-readonly-field#post-7034&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;This worked well, up until the point the form failed validation (let's say one of the required fields is left blank.  When the screen refreshed to display the validation messages, the pre-populated fields were blank. &#60;/p&#62;
&#60;p&#62;This only happened when the input fields were disabled.  My assumption is that the validation logic is not retaining the value attribute of disabled fields when the form is re-posted.  I had to re-enable the fields by removing the 'disable' class again in order to make this work properly&#60;/p&#62;
&#60;p&#62;Would this perchance be an easy fix?  Any suggestions?&#60;/p&#62;
&#60;p&#62;Thanks for the great plugin!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
