On form submission - multiple events

A form on my site has a drop down for subscriptions let’s call them bronze, silver and gold. I want to be able to achieve the following:

  • when the user successfully fills out the form and is able to submit it (passing validation/requirements) I want a new button to appear (hidden by default), let’s call this button external url.
  • i also want the value of the subscription returned so the following can happen
  • if subscription was bronze then on click of ‘external url’ takes the user to another web page using a link.
  • if subscrimotion was silver, then on click of ‘external url’ take user to a different web page specific to silver. Etc

im really hoping this is possible and any help would be massively appreciated!

You can use the wix-location.to() API function. Check the subscription, and then redirect where you want:

if(subscription === 'bronze') {
	wixLocation.to('https://www.bronzesite.com');
}
else if(subscription === 'silver') {
	wixLocation.to('https://www.silversite.com');
}
else if(subscription === 'gold') {
	wixLocation.to('https://www.goldsite.com');
}
else {
	// go somewhere else if not one of the above
}