Changing the destination path of a submit button to include parameters

Hi

What we’re trying to achieve…

Two forms, A and B.

When a user completes form A, they might get redirected to form B, depending on the data they entered into form A. If they are directed to form B, we want to be able to pre-populate some of the questions/answers.

I’ve created separate ‘Submit’ buttons for each of the criteria (redirect or no-redirect), but I’m struggling to get the pre-population working.

We already have form B set-up to pre-populate from URL parameters via the “URL param value” presenter, but how can I trigger this from the Submit button on form A?

On form A, in the config for my redirect submit button, I can set the destination to a specific page (Form B), but this doesn’t allow me to add any parameters.

I’ve tried setting the destination to external, specify as much of the form B url as I can, and then manipulate it via a fragment callback. It looks like it should work (when checking fragment_settings.independent_submission_settings.destination_path at the start, and end of my callback, I can see the destination_path has changed to include my parameters etc), but it always redirects to the original config.

Hope this all makes sense.

Any advice much appreciated.
Stephen

Hi Stephen,

One idea would be to create a composite link containing all of the required URL parameters and values captured from the form submission.

Then, when Form A is submitted (i.e. the submit button is clicked), instead of redirecting directly to the target destination, the user is first redirected to a intermediate page e.g. a “Thank you for submitting this report” page.

On this intermediate page, you could use the following wrapper Auto Redirect To A Link (Auto Redirect To A Link - Netcall Community) on your composite link, which would then automatically redirect the user according to the timer configured within the wrapper.

You can then amend the frontend.js within the wrapper so the redirect occurs after a short delay from when the intermediate page is loaded, for example 1 second (delay *= 1000; // Convert to milliseconds). You could also optionally hide the destination link from the intermediate page using CSS if required.

2 Likes