PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

iframe/HTML tags being stripped from field - how to disable this?

  1. I have a post-submission action on a form, which is setup like so:

    add_action("gform_post_submission_2", "update_event", 10, 2);
    function update_event($entry, $form) {
      $str_with_iframe = $entry[3];
      // $entry[3] has HTML stripped
    }

    The field with ID = 3 is a textarea "Paragraph Text" type.

    If I enter something into the field and submit the form, like:

    <iframe src="http://example.com/"></iframe>
    <a href="http://example.com">Visit the site</a>

    From within the post submission hook, the content of $entry[3] is merely

    Visit the site

    with all HTML tags stripped.

    How can I avoid these tags from being stripped in this manner?

    Edit: I am using Gravity Forms v1.6.2.1.1.

    Posted 12 years ago on Wednesday February 22, 2012 | Permalink
  2. Hi, wearethenest,

    That field type does not allow html in it and any tags are stripped out. There are two things you can do:
    1. Instead of pulling the value from $entry, you can use $_POST. If your field is 3, then use
    $str_with_iframe = $_POST["input_3"];
    2. Use the "gform_allowable_tags" hook to specify which tags are allowed so they do not get stripped out - http://www.gravityhelp.com/documentation/page/Gform_allowable_tags .

    Posted 12 years ago on Monday February 27, 2012 | Permalink
  3. Thank you Dana! The gform_allowable_tags hook is precisely what I need in this instance.

    Posted 12 years ago on Tuesday February 28, 2012 | Permalink

This topic has been resolved and has been closed to new replies.