Redirect to different URL based on input?

redirect to different URLs based on user input.

Overview

The issue is not knowing how to set up a conditional redirect using a switch in the form events.
Add a Switch event before the Redirect action, mapping input values to target URLs, and ensure the switch is configured in the Events area, not the Views design area.

Answered
ChronoForms v6
mo motberg 11 Jul, 2019
Hi there guys,

I am wondering if it would be possible to use an input field to redirect to different URLs?
For example, the field would say:

Enter Code
> User enters ABCD and it gets redirected to www.example.com
> User enters 1234 and it gets redirected to www.mydomain.com

And if user enters an incorrect code, they get an error message.

I can't figure out how to do this. I only know how to do a normal redirect to a url 🙄

Anyone who can point me in the right direction? Thanks a million!
he healyhatman 11 Jul, 2019
Answer
1 Likes
Use a switch. Let's say you call it switch_redirect

ABCD:www.example.com
1234:www.mydomain.com

In the redirect action, just use {var:switch_redirect}
mo motberg 15 Jul, 2019
Hi healyhatman,

Thanks for the tip, but I can't get it to work with my limited knowledge. I put in a Switcher Area (under the Design area) with the values that I needed but since I don't really know what I am doing, I put this Switcher Area under my Text Field, which I assume is the place I should put it?
Redirect to different URL based on input? image 1


Then I also put into the Setup area a Switch before the Redirect function and it's a no go. I am pretty sure I messed up along the way but I can't figure out where 🤗
Redirect to different URL based on input? image 2

Appreciate it very much if you can point me in the right direction?

Thanks so much.
he healyhatman 15 Jul, 2019
Nota switcher area, a switch. In events not views
mo motberg 15 Jul, 2019
Hi healyhatman,

Thanks a bunch! Finally got it to work🙂
This topic is locked and no more replies can be posted.