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.

Accessing the HTML of a gravity form

  1. I would like to add a marketing automation script to existing forms that exist on a client's site.

    My client does not have a desire to change the way forms are processed within the organization and has been using gravity forms for a little over 2 years. In order to add the tracking code and additional third party processing code, my only option is to add the raw code associated to the HTML of each gravity form. I've looked but cannot find where I can access this raw code?


    Posted 11 years ago on Monday September 10, 2012 | Permalink
  2. You can add HTML blocks to your Gravity Form. Is that what you mean?

    Normally for integration with third party services, you can use the gform_after_submission hook.

    If you can show us what code you need to execute, we can help you with the correct way to do it. Thanks.

    Posted 11 years ago on Monday September 10, 2012 | Permalink
  3. Not quite what I meant I don't think. We tried using the HTML box on a form but there was an issue with the redirect after submit. Below is SAMPLE code we would be placing in the HTML box should we determine that will work. At the end of the day, we need the information entered into each Gravity form to process per gravity form "rules" set for each form IN ADDITION to being processed by the terms defined by our marketing automation platform. (Fields mapped, URL redirect after submission, alerts sent to recipients)

    It was initially determined by ourselves and our marketing automation support team that we would need access to ALL of the HTML of the Gravity form as opposed to just "adding code" to the gravity form. I hope this is making sense... Look forward to your response.

    Posted 11 years ago on Monday September 10, 2012 | Permalink
  4. This makes sense, but this is not how Gravity Forms works. Each form is generated dynamically. If you want to grab the HTML of the generated form, you would have to view the source of a page where the form is embedded, and use that. You would have to ensure the proper CSS and scripts are added when the form is used in this manner, since Gravity Forms will have nothing to do with it at this point.

    This is not a supported use of Gravity Forms. Normally when integrating 3rd party services, we recommend using the gform_after_submission hook. That way, the form is processed by Gravity Forms, and you can also submit data to a third party, and additional form submission.

    You would not use the HTML field for this. I did not understand what you were trying to do completely when I offered that suggestion.

    Posted 11 years ago on Wednesday September 12, 2012 | Permalink