Forum

Thread tagged as: Question, Forms

Form set up for landing pages

Hi,

I need to allow my client to create a number of landing pages within Perch. Each landing page will display a short enquiry form, and on submission I need to return a thank you page. This thank you page will display content that is unique to the campaign, and will also need to include a Google Analytics script that is specific to the campaign.

Although the contents of each landing page are unique, the enquiry form will ask for the same user info on each landing page, and doesn't need to be editable. So I'd planned to just display the same form on each landing page using <?php perch_form('landing-form.html'); ?> and then set the form's (on success) redirect url to be the desired thank you page.

But now I realise that of course the redirection url set for this form will apply the same thank you page for every campaign. Whereas I need to redirect to a custom thank you page for each campaign.

I think that if I could dynamically change the form id then each form would show up individually in the Perch admin and I could then assign a new redirection url for each form, which would be perfect. But I don't think this is possible.

Do you have any suggestion as to how I might solve this?

Thanks in advance for your help.

Simon Kelly

Simon Kelly 0 points

  • 5 years ago

Hi again,

Perhaps I can phrase this a bit more succinctly ;)

Is it possible to dynamically change the id of a form (for example by passing a variable)?

Is it possible to use the same form on multiple pages and have each instance redirect to a different page on successful completion?

If the answer to the above is no and no, is there any way to achieve what I'm looking for?

Thanks for any help ;)

Drew McLellan

Drew McLellan 2638 points
Perch Support

You can't have a dynamic form ID, it needs to be fixed.

You could possibly include the redirect URL in a hidden field, and then add your own code to do the redirect after successful submission, but that might be a bit long winded.