Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save noahub/ee4fd2a1eb8b3096cf29952548ebedab to your computer and use it in GitHub Desktop.
Save noahub/ee4fd2a1eb8b3096cf29952548ebedab to your computer and use it in GitHub Desktop.
Change form destination URL by dropdown selection on Unbounce
  1. Be sure to first change your forms confirmation to 'Goto another webpage' and set a default fallback URL

  2. Drop this script into your javascript box. Set the placement to 'before body end tag'

<script>

$("#gender").live('change', function() {
 
  switch ($(this).val()) {
      
    case 'Male':
        window.module.lp.form.data.confirmData = "http://www.google.com";
        break;
    case 'Female':
        window.module.lp.form.data.confirmData = "http://www.bing.com";
        break;
  }
  
});
  
</script>
  1. Replace 'gender' with the ID of your dropdown field.

  2. Modify or add as many different 'cases' as you need

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment