Dynamically Populate HTML Field with 2 previous fields

I’m trying to set the field content of an HTML field to populate with a string and 2 defined variables (Submissions pulled from previous page). It outputs the strings fine, just not the variables. Any ideas on how to make this work?


Thanks in advance!

Hi Eric,

I am an independent PHP developer and user of GF, I’m here just trying to be a friendly and helpful person.

Your question caught my eye because I’ve been working with Gravity Forms recently in a similar area, and am looking for some beta testers for a new (free) “shared fields” plug-in I’ve written.

As do your question about your code function, it has at least three obvious issues:

  1. You are over-writing the contents of field[‘id’] with the values 41 and 6.
  2. You are not appending the contents of your $input_ variables into the field[‘content’] string.
  3. You are only iterating the one if statement - as you have not brackets for the foreach

Maybe my plug-in can help you. Let me ask you this:

If your input fields on the previous page hold the values you want to populate into the HTML block, then just using my “shared fields” plug-in will do the trick.

I have two demos of this being used with no PHP code required, drop me a DM if you are interested in checking this out.



Hey There!

I don’t know how to DM you, but I’m more than interested. I’m Andrew btw–I’m the dev working on this project. I’d love to checkout the plugin and give you feedback as you develop it. Shoot me an email andrew@andrewjschultz.com