How can I make a single form that can have a confirmation linking to a page defined by the form's parent page? [RESOLVED]

I am trying to create a single form using Gravity Forms to use to get contact information and allow access to a download page. I can make it work for a single form, pointing to a single page, however, I do not wish for authors to have to create a new form for every post/downloadable asset landing page. I would like to make a single form that can be used multiple times with a different target page. Is there a way to create a form that uses data from a hidden variable in the page the form is on to define where the confirmation link navigates to? For example, the content author could insert the form, and then enter the url or page shortlink info to tell the form where to navigate?

I apologize for my lack of knowledge. I am trying to help someone out who had a site built for them. The designers are using Wordpress, Divi and Gravity Forms. I have html/css and application programming experience, but I have no previous php or wordpress experience and have been trying to crash course my way through.

Thank you.

Oh, also is there a way to have the notifications include the same info, so the data received includes what page the submission is from? I don’t know if this is possible, or if I just need to create a new form every time? Creating a new form every time may be cumbersome, but now that I am thinking about it, having a form for each link/page would help make it clear which links are generating more contacts since the entries would be separate? I would appreciate any advice on this.

Hi Jeffrey. Yes, you can do that. You’re correct that you should use one form on every page. And in order to redirect to some specific page after submission depending on the page, I recommend storing the page ID or the slug of the page in a custom field on the page where the form was embedded. At that point, you will be able to pull information from the custom field, into a form field, then use that in your confirmation redirect.

If you can use a custom field in the main pages (where the form is embedded) then you can populate a hidden field in the form with the {embed_post} merge tag.

For example, give the main page a custom field with the key “redir_url”. You will need what to decide to use for a value. This can be a page title, page URL, page ID or page slug. Let me know what you want to store there, and I can help you with the confirmation redirect to that page.

Thank you. That sounds like exactly what I am looking for.

Basically, the site owner wants to have pdfs and other media files available for download, but wants customer info (name & email) to access the downloads for list generation. But he also wants to be able to list all of the downloads in a sort of library. So, what I am trying to develop is to have a download page for each downloadable asset, and to create a blog post that is a landing page for the download where the contact info form will be embedded. The confirmation of that form will link to the download page. These blog posts will be in a special category so I can have a blog page that lists only those blogs with that category to fullfill the owners desire to have a library of those assets available to the customer.

There is probably a more elegant way to do this, but as I said I am new to wordpress, or php based sites in general and don’t have the time to learn it as well as I probably should, at least not in the short term.

Ok, so I have a custom field in the post, and have it set to populate a hidden field in the form dynamically. What syntax do I use to populate the hidden field, and what syntax do I use to enter that in the redirect URL field on the confirmation page?

Fantastic, I got it working perfectly. Thank you for your response and expertise!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.