Custom downloadlink after submitting form


I’m looking for a way to add a custom confirmation message (download link) after a form is submitted.

  • The form is a simple name/email, that has to remain the same throughout the website.

  • The download-link is custom set and varies for each page/element.

So essentially a custom confirmation message that varies from page to page, but linked to one simple form.

Is there a way to achieve this? I can do some basic PHP and jquery so I thought of hiding/showing specific content, but how do I trigger it after the form has been submitted?


Edit: apparently it’s called a (lead capture form). However, this would require making a new ‘post’ for each form. I’d much prefer to set an ACF file/link field on the content page itself.

Edit 2: I have sort of managed it. I have added

add_action( 'gform_after_submission', 'show_download_after_submission', 10, 2 );
function show_download_after_submission( $entry, $form )  { 

However, upon submitting the page scrolls to the “thanks” message, but this code shows up above that (out of view in my case). Is there a way to display the code inside the gform_confirmation_wrapper? Or perhaps have the automated scroll anchored to a different div?

gform_after_sunmission is too late. Have you tried using the gform_confirmation filter?

It’s designed for changing the confirmation message or destination dynamically.

1 Like

Yea I found that after I posted, from what I see I can import ACF fields that way as well which would solve my issue. Haven’t tried it yet, but I assume that solves my question. Thanks!

If you need help getting that to work, please let us know.