Lead Capture Tools

juusui
Participant

Single form for multiple pages, multiple thank you pages

SOLVE

We're using our WordPress website for landing pages and thank you pages. We embed the form on the WP landing page and redirect to another WP thank you page after form submission.

 

We have multiple pages that collect the same info so we would like to use the same form. However, we would need to redirect to a thank you page specific to the landing page. 

 

Here's an example:

  • Both LP1 and LP2 use FormA
  • When I user completes FormA on LP1, it should redirect to Thank You Page 1
  • When I user completes FormA on LP2, it should redirect to Thank You Page 2

 

Does anyone know how to set this up? Would this be more appropriately asked in the developer discussions?

0 Upvotes
1 Accepted solution
Ben_M
Solution
Key Advisor

Single form for multiple pages, multiple thank you pages

SOLVE

For this you will need to customize the form embed code so that the same form can go to different thank you pages, display different messages, do different tasks, etc.

 

https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options 

View solution in original post

3 Replies 3
Ben_M
Solution
Key Advisor

Single form for multiple pages, multiple thank you pages

SOLVE

For this you will need to customize the form embed code so that the same form can go to different thank you pages, display different messages, do different tasks, etc.

 

https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options 

juusui
Participant

Single form for multiple pages, multiple thank you pages

SOLVE

This is exactly what I need. Thank you. 

0 Upvotes
nickbudjml
Participant

Single form for multiple pages, multiple thank you pages

SOLVE

Hey guys! @juusui and @Ben_M 

 

I'm trying to do the same, but don't have much dev experience. (Logic skills strong, syntax/language skills weak).

 

I'd like to do:

onFormSubmit

use IF logic to assign the proper redirectUrl string. 

I don't know the right format. Would love a little advise!

 

My thought:

 

onFormReady: function($form) {

if ( 
	(
		document.querySelector("input[name='FIELD-NAME']").value = "INPUT-VALUE"
		&&
		document.querySelector("input[name='FIELD-NAME']").value = "INPUT-VALUE"
		&&
		document.querySelector("input[name='FIELD-NAME']").value = "INPUT-VALUE"
	)
	||
	(
		document.querySelector("input[name='FIELD-NAME']").value = "INPUT-VALUE"
		&&
		document.querySelector("input[name='FIELD-NAME']").value = "INPUT-VALUE"
		&&
		document.querySelector("input[name='FIELD-NAME']").value = "INPUT-VALUE"
	) 
){

// if field value is a specific results, then set value of redirectUrl to a hardcoded URL I desire 
	redirectUrl.value = "https://THE-PAGE-I-WANT.com/" ;
}
if ( 
	(
		document.querySelector("input[name='FIELD-NAME']").value = "INPUT-VALUE"
		&&
		document.querySelector("input[name='FIELD-NAME']").value = "INPUT-VALUE"
	) 
){

// if field value is a specific results, then set value of redirectUrl to a hardcoded URL I desire 
	redirectUrl.value = "https://THE-PAGE-I-WANT.com/" ;

} else {
// Otherwise, set value of redirectUrl to a default hardcoded URL I desire 
	redirectUrl.value = "https://THE-PAGE-I-WANT.com/" ;
}

 

0 Upvotes