Hi,
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?
Best,
Dave
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 ) {
the_field('link');
}
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?