<?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 Tag: iframe - Recent Posts</title>
		<link>https://legacy.forums.gravityhelp.com/tags/iframe</link>
		<description>Gravity Support Forums Tag: iframe - Recent Posts</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 00:57:17 +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/tags/iframe" rel="self" type="application/rss+xml" />

		<item>
			<title>Richard Vav on "gform_enqueue_scripts injects script into iframe on validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_enqueue_scripts-injects-script-into-iframe-on-validation-error#post-316671</link>
			<pubDate>Tue, 11 Jun 2013 05:01:24 +0000</pubDate>
			<dc:creator>Richard Vav</dc:creator>
			<guid isPermaLink="false">316671@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Alex
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "gform_enqueue_scripts injects script into iframe on validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_enqueue_scripts-injects-script-into-iframe-on-validation-error#post-315708</link>
			<pubDate>Mon, 10 Jun 2013 16:00:15 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">315708@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Enqueueing initialization scripts is a bit tricky, especially when dealing with AJAX forms. The recommended way of doing it is using the add_init_script() function. This function will make sure the script is printed at the right time and executed when needed. Some scripts need to be executed only once when the page is loaded, and some will need to be executed every time a conditional logic operation takes place, and this function has a parameter that controls that.&#60;br /&#62;
I have modified the sample code from richardvav above to use the add_init_script() function to give you an example.&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/8031737&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/8031737&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I hope it is helpful and useful to all.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jacobdubail on "gform_enqueue_scripts injects script into iframe on validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_enqueue_scripts-injects-script-into-iframe-on-validation-error#post-299196</link>
			<pubDate>Mon, 03 Jun 2013 12:00:49 +0000</pubDate>
			<dc:creator>jacobdubail</dc:creator>
			<guid isPermaLink="false">299196@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks richardvav!  &#60;/p&#62;
&#60;p&#62;I appreciate your help.  I'll give this new hook a try and report back.  &#60;/p&#62;
&#60;p&#62;Wondering if any of the core developers can chime in to let us know if this is intended behavior or not.&#60;/p&#62;
&#60;p&#62;Thanks again!&#60;br /&#62;
-Jacob
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Widget in wordpress enabled external page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/widget-in-wordpress-enabled-external-page#post-279462</link>
			<pubDate>Mon, 27 May 2013 00:37:25 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">279462@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is an old topic, but for anyone reading, Gravity Forms will only work when embedded in a WordPress page, post, widget or template file.  Gravity Forms require WordPress to work.    Your iFrame solution is the best I know of when you need to embed a Gravity Form (and WordPress page or post) in a non-WordPress website.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "embed form into Facebook page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/embed-form-into-facebook-page#post-273312</link>
			<pubDate>Fri, 24 May 2013 10:09:02 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">273312@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You will want to contact a developer that is familiar with WordPress and Facebook to do this for you, as we haven't ever done it ourselves. We have a Job Board on our forums or there are sites like jobs.wordpress.net or Odesk.com.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jbellclemson on "embed form into Facebook page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/embed-form-into-facebook-page#post-272285</link>
			<pubDate>Fri, 24 May 2013 01:42:55 +0000</pubDate>
			<dc:creator>jbellclemson</dc:creator>
			<guid isPermaLink="false">272285@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;can you please help me do this? I have a fan page app tab that has the wordpress page as the confirmation page after opting in via the facebook app..the gravity form should be the next page it direct me to, but it's blank. how do i iframe it?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Richard Vav on "gform_enqueue_scripts injects script into iframe on validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_enqueue_scripts-injects-script-into-iframe-on-validation-error#post-257452</link>
			<pubDate>Fri, 17 May 2013 07:11:19 +0000</pubDate>
			<dc:creator>Richard Vav</dc:creator>
			<guid isPermaLink="false">257452@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Jacob, I tried your script on my localhost setup using a clean install and the twenty twelve theme and for some reason the script is being printed in both the head and the body so I am getting the &#34;jQuery is not defined&#34; error when the page first loads and the placeholders aren't appearing.&#60;/p&#62;
&#60;p&#62;Anyway if I swap from gform_enqueue_scripts to gform_pre_render and I bind the function to gform_post_render as shown below, the script is only printed in the body and the placeholders now appear and also work if the form is submitted and fails validation due to the field being empty.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_pre_render&#38;#39;, &#38;#39;jtd_gform_enqueue_scripts&#38;#39;);
function jtd_gform_enqueue_scripts($form) {
?&#38;gt;
  &#38;lt;script&#38;gt;
    jQuery(document).bind(&#38;#39;gform_post_render&#38;#39;,function(){
    &#38;lt;?php
      /* Go through each one of the form fields */
      foreach($form[&#38;#39;fields&#38;#39;] as $i=&#38;gt;$field) {
        /* Check if the field has an assigned placeholder */
        if(isset($field[&#38;#39;placeholder&#38;#39;]) &#38;amp;&#38;amp; !empty($field[&#38;#39;placeholder&#38;#39;])){
          /* If a placeholder text exists, inject it as a new property to the field using jQuery */
          ?&#38;gt;
          jQuery(&#38;#39;#input_&#38;lt;?php echo $form[&#38;#39;id&#38;#39;]?&#38;gt;_&#38;lt;?php echo $field[&#38;#39;id&#38;#39;]?&#38;gt;&#38;#39;)
                 .attr(&#38;#39;placeholder&#38;#39;,&#38;quot;&#38;lt;?php echo $field[&#38;#39;placeholder&#38;#39;]?&#38;gt;&#38;quot;);
        &#38;lt;?php
        }
      }
    ?&#38;gt;
    });
  &#38;lt;/script&#38;gt;
&#38;lt;?php
     return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;However I still get the &#34;jQuery is not defined&#34; error when validation failed so it's not just gform_enqueue_scripts that results in the script being printed in the iframe and i'm at a loss as how to prevent it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jacobdubail on "gform_enqueue_scripts injects script into iframe on validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_enqueue_scripts-injects-script-into-iframe-on-validation-error#post-255683</link>
			<pubDate>Thu, 16 May 2013 12:14:04 +0000</pubDate>
			<dc:creator>jacobdubail</dc:creator>
			<guid isPermaLink="false">255683@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sure can.  Here you go:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_field_standard_settings&#38;quot;, &#38;quot;jtd_gform_placeholders&#38;quot;, 10, 2);

function jtd_gform_placeholders($position, $form_id){

  // Create settings on position 25 (right after Field Label)
  if ( $position == 25 ) {
  ?&#38;gt;

    &#38;lt;li class=&#38;quot;admin_label_setting field_setting&#38;quot; style=&#38;quot;display: list-item; &#38;quot;&#38;gt;
      &#38;lt;label for=&#38;quot;field_placeholder&#38;quot;&#38;gt;Placeholder Text
        &#38;lt;!-- Tooltip to help users understand what this field does --&#38;gt;
        &#38;lt;a href=&#38;quot;javascript:void(0);&#38;quot; class=&#38;quot;tooltip tooltip_form_field_placeholder&#38;quot; tooltip=&#38;quot;&#38;lt;h6&#38;gt;Placeholder&#38;lt;/h6&#38;gt;Enter the placeholder/default text for this field.&#38;quot;&#38;gt;(?)&#38;lt;/a&#38;gt;
      &#38;lt;/label&#38;gt;
      &#38;lt;input type=&#38;quot;text&#38;quot; id=&#38;quot;field_placeholder&#38;quot; class=&#38;quot;fieldwidth-3&#38;quot; size=&#38;quot;35&#38;quot; onkeyup=&#38;quot;SetFieldProperty(&#38;#39;placeholder&#38;#39;, this.value);&#38;quot;&#38;gt;
    &#38;lt;/li&#38;gt;
  &#38;lt;?php
  }
}

/* Now we execute some javascript technicalitites for the field to load correctly */

add_action(&#38;quot;gform_editor_js&#38;quot;, &#38;quot;jtd_gform_editor_js&#38;quot;);
function jtd_gform_editor_js(){
?&#38;gt;
  &#38;lt;script&#38;gt;
    //binding to the load field settings event to initialize the checkbox
    jQuery(document).bind(&#38;quot;gform_load_field_settings&#38;quot;, function(event, field, form){
      jQuery(&#38;quot;#field_placeholder&#38;quot;).val(field[&#38;quot;placeholder&#38;quot;]);
    });
  &#38;lt;/script&#38;gt;

&#38;lt;?php
}

/* We use jQuery to read the placeholder value and inject it to its field */

add_action(&#38;#39;gform_enqueue_scripts&#38;#39;,&#38;quot;jtd_gform_enqueue_scripts&#38;quot;, 10, 2);
function jtd_gform_enqueue_scripts( $form, $is_ajax ) {

  if ( $is_ajax ) :
?&#38;gt;
  &#38;lt;script&#38;gt;
    (function( $ ) {
    &#38;lt;?php
      /* Go through each one of the form fields */
      foreach($form[&#38;#39;fields&#38;#39;] as $i=&#38;gt;$field) {
        /* Check if the field has an assigned placeholder */
        if(isset($field[&#38;#39;placeholder&#38;#39;]) &#38;amp;&#38;amp; !empty($field[&#38;#39;placeholder&#38;#39;])){
          /* If a placeholder text exists, inject it as a new property to the field using jQuery */
          ?&#38;gt;
          jQuery(&#38;#39;#input_&#38;lt;?php echo $form[&#38;#39;id&#38;#39;]?&#38;gt;_&#38;lt;?php echo $field[&#38;#39;id&#38;#39;]?&#38;gt;&#38;#39;)
            .attr(&#38;#39;placeholder&#38;#39;,&#38;quot;&#38;lt;?php echo $field[&#38;#39;placeholder&#38;#39;]?&#38;gt;&#38;quot;);
        &#38;lt;?php
        }
      }
    ?&#38;gt;
    })(jQuery);
  &#38;lt;/script&#38;gt;
&#38;lt;?php
  endif; // $is_ajax
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Hopefully that comes through correctly.&#60;/p&#62;
&#60;p&#62;Thanks again for your help!&#60;/p&#62;
&#60;p&#62;-Jacob
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Richard Vav on "gform_enqueue_scripts injects script into iframe on validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_enqueue_scripts-injects-script-into-iframe-on-validation-error#post-253598</link>
			<pubDate>Wed, 15 May 2013 02:09:22 +0000</pubDate>
			<dc:creator>Richard Vav</dc:creator>
			<guid isPermaLink="false">253598@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Jacob,&#60;/p&#62;
&#60;p&#62;Can you paste a copy of the full code you are using for this from your functions file?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jacobdubail on "gform_enqueue_scripts injects script into iframe on validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_enqueue_scripts-injects-script-into-iframe-on-validation-error#post-253284</link>
			<pubDate>Tue, 14 May 2013 20:53:26 +0000</pubDate>
			<dc:creator>jacobdubail</dc:creator>
			<guid isPermaLink="false">253284@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi richardvav,&#60;/p&#62;
&#60;p&#62;Thanks a lot for your reply.  Sorry for my delayed response.&#60;/p&#62;
&#60;p&#62;I updated my script and am now getting the output you recommend.  I'm still seeing this script injected into the iframe, though.&#60;/p&#62;
&#60;p&#62;Here's a screenshot from my dev tools in Chrome: &#60;a href=&#34;http://i.imgur.com/MiJbGrF.png&#34; rel=&#34;nofollow&#34;&#62;http://i.imgur.com/MiJbGrF.png&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I'm still getting a &#34;jQuery is not defined&#34; error.&#60;/p&#62;
&#60;p&#62;Any idea how I can prevent scripts hooked to &#34;gform_enqueue_scripts&#34; from being inserted into the iframe?&#60;/p&#62;
&#60;p&#62;Thanks!&#60;/p&#62;
&#60;p&#62;-Jacob
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
