Conditional Lead Form with Multi-Step Landing Pages


Hi everyone,

I was using 2 landing pages for lead capturing using a conditional field on the first landing page. The script that we were using was the following but after the removal of jQuery dependency, the condition doesn’t work:

<script>

  
  $(function(){
        $('[name="lead_estimated_monthly_volume"] option').each(function (key, value) {
          var that = $(this);
          switch (that.val()) {
            case "€0 - €150,000":
              that.val(150000);
              break;
            case "€150,000 - €1,000,000":
              that.val(1000000);
              break;
            case "€1,000,000 - €5,000,000":
              that.val(5000000);
              break;
            case "€5,000,000 - €8,000,000":
              that.val(7999999);
              break;
            case "€8,000,000 or more":
              that.val(8000001);
              break;
          }
        });
         $('[name="industry"] option').each(function (key, value) {
            var that = $(this);
            switch (that.val()) {
                case "Digital Goods & Services":
                    that.val("Digital Goods");
                    break;
                case "Travel & Ticketing":
                    that.val("Travel");
                    break;
                case "Retail":
                    that.val("Retail");
                    break;
                case "Financial Services":
                    that.val("Finance");
                    break;
                case "Marketplace":
                    that.val("Marketplace");
                    break;
                case "Other":
                    that.val("Unknown");
                    break;
                case "Gaming":
                    that.val("Games");
                    break;
                case "Gambling":
                    that.val("Gaming");
                    break;
                }
            });
            var industry = $('#industry');
            var lead_estimated_monthly_volume = $('#lead_estimated_monthly_volume');
            var redirectValues = ['Digital Goods', 'Travel', 'Retail', 'Unknown'];
            industry.change(function () {
                var that = $(this);
                if ($.inArray(industry.val(), redirectValues) > -1 && lead_estimated_monthly_volume.val() < 5000001) {
                    window.module.lp.form.data.confirmData = 'https://www.safecharge.com/try-now';
                } else {
                    window.module.lp.form.data.confirmData = 'https://www.safecharge.com/payment-solution-get-started';
                }
            });
            lead_estimated_monthly_volume.change(function () {
                var that = $(this);
                if ($.inArray(industry.val(), redirectValues) > -1 && lead_estimated_monthly_volume.val() < 5000001) {
                    window.module.lp.form.data.confirmData = 'https://www.safecharge.com/try-now';
                } else {
                    window.module.lp.form.data.confirmData = 'https://www.safecharge.com/payment-solution-get-started';
                }
            });
  });

 
 
</script>

The 1st step/page is this: https://www.safecharge.com/payment-solution-lp/

Looking forward to receive your suggestions.


2 replies

window.module.lp.form.data does not have ‘confirmData’ anymore. Try changing it to ‘url’ and see if that works.

It worked! Thanks a lot @benr for your help! 👌

Reply