Lead Capture Tools

juusui
Teilnehmer/-in

Single form for multiple pages, multiple thank you pages

lösung

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 Akzeptierte Lösung
Ben_M
Lösung
Autorität

Single form for multiple pages, multiple thank you pages

lösung

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 

Lösung in ursprünglichem Beitrag anzeigen

3 Antworten
Ben_M
Lösung
Autorität

Single form for multiple pages, multiple thank you pages

lösung

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
Teilnehmer/-in

Single form for multiple pages, multiple thank you pages

lösung

This is exactly what I need. Thank you. 

0 Upvotes
nickbudjml
Teilnehmer/-in

Single form for multiple pages, multiple thank you pages

lösung

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