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.

Conditional HTML Fields to display on confirmation

  1. dreamwhisper
    Member

    I have 4 HTML fields set to display based on whether or not checkboxes are checked on a previous page of a multipage form (Version 1.5beta). The conditional logic works perfectly to display them in the form.

    I'd like these fields, which contain only links, to display on the confirmation page. I've used the insert fields dropdown to insert them. However, they don't display. Other inserted fields are working correctly.

    Posted 9 years ago on Tuesday November 9, 2010 | Permalink
  2. The HTML blocks aren't intended to be displayed in the notifications like the other fields as they're not associated with a value. They're not actual form inputs. If they're still showing up as available fields in the notification screens, we'll most likely have to exclude them to prevent confusion.

    Posted 9 years ago on Wednesday November 10, 2010 | Permalink
  3. dreamwhisper
    Member

    Yes, they are available. Though, I do think it would be handy for them to work. For instance, you could 'easily' display recommendations on the confirmation page based on responses to form questions.

    Posted 9 years ago on Wednesday November 10, 2010 | Permalink
  4. There's more potential for the fields to break the notification email with bad markup. They were never intended to be included in the notifications.

    What you could do is use paragraph text fields with default values for the recommendations. Those would show up in the notification email.

    Posted 9 years ago on Wednesday November 10, 2010 | Permalink
  5. dreamwhisper
    Member

    Yes, I suppose bad markup would break notification emails or any page it was populated on such as the confirmation page, or even the form page they are on to start with. (though I would say that's user responsibility not yours LOL).

    Using paragraph text fields works for textual recommendations, but doesn't for HTML markup. (HTML doesn't save in the form, but text does) It would make for a mess in form too.

    I'd experiment with hidden fields and jquery, but as hidden fields have no default conditional capability I'd need to deal with that too.

    Edit: HTML is saving, but in both the HTML block and the paragraph block, it doesn't save unless I add a space after the entered HTML.

    Posted 9 years ago on Wednesday November 10, 2010 | Permalink
  6. dreamwhisper
    Member

    Update: Your method works to the extent that it does output the text of the recommendation and I can hide it in form. However, the HTML is removed from the output and it displays only the text portion of the link.

    Posted 9 years ago on Wednesday November 10, 2010 | Permalink
  7. Conditional notifications are really not something we support right now. Texareas will have HTML stripped from them and HTML blocks are not intended to be used as variable replacements.
    Your only solution here is to use a hook and manually create the emails using PHP. If this seems like a viable solution, I can give you a code snippet to get you started.

    Posted 9 years ago on Wednesday November 10, 2010 | Permalink
  8. dreamwhisper
    Member

    Thanks for bearing with me.

    I'm not sure why you say conditional notifications are really not supported, unless you mean something like: Only send notification if a condition is present. This isn't what I'm after. Natively, GF is supporting what I want for the conditional when using the paragraph text fields. However, I need to prevent stripping the HTML from the field so the link remains intact. So, if you have a snippet that will point me in the right direction for that, I'd be happy.

    (I'm very happy with Gravity Forms. It's an excellent plugin. )

    Posted 9 years ago on Wednesday November 10, 2010 | Permalink
  9. The problem is that the textarea field does not allow HTML, so the HTML is stripped from it when saving the data. By the time we send the notification, the HTML is gone and we can't get it back.
    Like I said, the one way to do this right now is via a hook. It is not as user friendly as the approach you are trying to do, but it will work.
    I can help you with a code snippet if you are interested.

    Posted 9 years ago on Thursday November 11, 2010 | Permalink
  10. dreamwhisper
    Member

    Yep, I'm interested.

    Posted 9 years ago on Thursday November 11, 2010 | Permalink
  11. Give the following a try. Paste it in your theme's function.php and remember to replace the IDs in the code with your actual IDs.
    One limitation that I just realized is that you won't be able to add any image to the email message. If this is something you need, we might be out of luck on this one.

    http://pastie.org/1291129

    Posted 9 years ago on Thursday November 11, 2010 | Permalink