Directing Submit button based on option selected


#1

I have a form with 3 drop down options. I want the submit button to send them to a page depending on which option was selected. how do i do that?


#2

I have the same question. This would be greatly helpful as I would like to redirect certain users to a different page based on information received from them. For instance, I am in real estate, and I would like to direct investors to a different website then I direct end-users to. It would allow me to give them back better defined content for their needs. Currently, I have to have general content on the page that applies to both types of users.


#3

Hey Anthony - this makes sense but unfortunately, it’s not possible with Unbounce forms right now. I’ve turned this thread into a feature request for you though.

In the mean time, you may want to look into embedding a Wufoo form instead. They should be able to support dynamic redirects.


#4

Hi,

Is there any news on that?


#5

Hi,

Is there any news on that feature?

Regards,
T


#6

Hi Tilen - we’ll likely be looking into improving form functionality sometime in the future, but right now we’re focussed on other features that we’ve received more requests for.

Would your set-up be the same as Kai’s original question–a drop down with each choice leading to a different page? Or something a bit different?


#7

It would be for radio buttons but in theory is the same.

We will however try to do it with redirect based on URL parameter.

Do you have any script for this prepared? So it would look like this:

Selection is appended to url (the function in form settings)–> landing page with script that reads an URL and redirects based on this

Regards,
T


#8

Hi Tilen,

Something like this should work for you:

<script> <br />
function getQueryStringArray(){ <br />
  var assoc=[];
<br />
  var items = window.location.search.substring(1).split('&');
<br />
  for(var j = 0; j < items.length; j++) {
<br />
     var a = items[j].split('='); assoc[a[0]] = a[1];
<br />
  } <br />
  return assoc; <br /> } <br /><br /> //point at which you want to determine redirection <br /> var qs = getQueryStringArray(); <br /> var url = ''; <br /> if (qs.city !== 'undefined' && qs.city) { <br />
 switch (qs.city) { <br />
    case 'Vancouver': <br />
       url = 'http://unbounce.quinnomori.com/vancouver/'; <br />
       break; <br />
    case 'Toronto':
<br />
       url = 'http://unbounce.quinnomori.com/toronto/'; <br />
       break; <br />
 } <br /><br />
 window.location.href = url; //reroute <br />
} <br /> </script>   

You’ll need to change “qs.city” to “qs.yourfieldname”, the “case” values from Vancouver and Toronto to whatever your radio button options are, and then the url fields to your individual thank-you pages.

You’ll want to place the script on it’s own page, using that as the initial form confirmation page (and then the redirect will fire sending visitors to the appropriate thank-you page).


#9

Great support. Thank you very much. Will test tomorrow and report back.

Regards,
T


#10

It works wonders! Just the one thing I would add is to write the UTMs from the landing page :slight_smile:

But other than that it works perfectly.


#11

Hi Tilen, good question!

Here’s a slightly modified version of Quinn’s script that’ll send the URL parameters (including UTM) over as well:

var assoc=[];
<br />
var items = window.location.search.substring(1).split('&');
<br />
for(var j = 0; j < items.length; j++) {
<br />
  var a = items[j].split('='); assoc[a[0]] = a[1];
<br />
} <br />
return assoc; <br /> } <br /><br /> //point at which you want to determine redirection <br /> var qs = getQueryStringArray(); <br /> var url = ''; <br /> if (qs.city !== 'undefined' && qs.city) { <br />
switch (qs.city) { <br />
  case 'Vancouver': <br />
    url = 'http://unbounce.quinnomori.com/vancouver/' + window.location.search; <br />
    break; <br />
  case 'Toronto':
<br />
    url = 'http://unbounce.quinnomori.com/toronto/' + window.location.search; <br />
    break; <br />
} <br />
window.location.href = url; //reroute <br /> } <br /> </script>```