I’m looking for a script which allows me to send the user to either page A or page B, depending on the value of a dropdown field. For example:
User selects that they like Apples so they go to /thank-you/apples, or user selects they like oranges so they go to /thank-you/oranges.
Does anybody have a script handy that would do this?
Thanks!
Page 1 / 2
Eliot,
Here is a script that an Unbounce team member had put together. You should be able to edit your field names and get along just fine if you are comfortable with a little javascript editing.
I got this same script from Unbounce tech support, but it doesn’t seem to be working.
And the JS code I added looks like this (I’m no coder, just to be clear):
However, at this point “Self” is not going anywhere different. Any thoughts? :-/
I have seen a few other inquiries about using this script recently. So I figured I should post the update that works in this thread. Special thanks to @Hristian for making it work!
Can somebody please help me. I am using a script that I have used perfectly in the past but for some reason, I can not get it to work on this page. I am trying to send users to one url if the select “Yes” in the drop down and to another if the select “No” in the dropdown. Here is the scrip I am using: (I have it set to Before End Body Tag"
case 'Yes':
window.module.lp.form.data.confirmData = "https://approvals.xxxxxxx.com/business-funding-thank-you/";
break;
case 'No':
window.module.lp.form.data.confirmData = "https://approvals.xxxxxxx.com/business-funding-thank-you2/";
break;
}
});
</script>
For some reason the page is ignoring the script. The field name is correct and I have it set to “go to URL” and append is checked. There is a fallback url set as well and that is always where it is taking the user. Please help
Here’s how I’m doing it on my page. Your code looks the same as mine, EXCEPT you have a semi-colon after the curly brace in the 2nd to last line… I’m no code expert, but could that be causing a problem?
My drop-down selections are as follows:
Who are you providing care for? (field is p_relation)
myself
spouse
parent
other
Depending on what they choose i send them to 2 different pages. JS below…
Hi, thanks for your reply. Sadly, removing the semi-colon didn’t change anything.
I am trying to get this to work as well and no matter what I tried from all these article threads nothing is working. It would be great if someone who has gotten this to work can provide complete instructions from beginning to end on how to set this up. There is a lot of conflicting information in this forum on how this should be done.
Checking in!
Has anyone figured this out?
I’ve followed this thread through and through and it’s still not working.
Can you do this on a text field using a number range?
Example:
<20 goes to url1, >20 goes to url2
Hi! Does anyone has the solution for this? I tried to copy the scripts you wrote in the conversation but it’s still not working in my page.
Thanks!
Hey @MDesign this is the latest edition that has worked. Have you tried to mimic this one?
Also, could you share your page URL so we could take a look further?
Hey, thanks for the answer!
I’m using the latest edition but still not working, don’t know why.