Question

Form Condition Redirect July 2024

  • 8 July 2024
  • 1 reply
  • 11 views

Badge

I’m working on adding a custom script so that depending on teh selection in a dropdown menu, the form directs to different websites. Here is what I have so far…..my drop down form field is titled a2 . . . .do I put $(“a2”).on….. in the script below? Wgat do I put for the “case” options? The actual selection? So if the choice says “Blue” . . . do I put ….. case ‘blue’: …..?

 

 

   <script>

$("#your_drop_down_id").on('change', function() {

switch ($(this).val()) {

case '#your_dropdown_field_id':
window.module.lp.form.data.url= "http://www.google.com";
break;
case '#your_dropdown_field_second_id':
window.module.lp.form.data.url= "http://www.bing.com";
break;
}

});

</script>

1 reply

Userlevel 4
Badge +1

@joshua.m.sells i’ve replied on your other topics. Please check and let me know if you have any other questions: 

 

Reply