Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minakshi-sharma/edf7ab6c531d9d3f8033395cd1cbef6a to your computer and use it in GitHub Desktop.
Save minakshi-sharma/edf7ab6c531d9d3f8033395cd1cbef6a to your computer and use it in GitHub Desktop.
Form Redirect Based on Dropdown Field Value
<script>
document.getElementById('lp-pom-button-23').onclick = function() {
var question1 = document.getElementById('did_you_or_a_loved_one_have_the_paragard_iud_birth_control_device_implanted').value;
var question2 = document.getElementById('were_you_or_a_loved_one_injured_by_a_broken_paragard_at_any_time').value;
var question3 = document.getElementById('in_what_year_was_the_paragard_implanted').value;
if ((question1 == "Yes") && (question2 == "Yes") && (question3 != "Before 2002")) {
window.module.lp.form.data.url = "https://get.paragardlawyers.com/confirmed/?Did_you_or_a_loved_one_have_the_ParaGard_IUD_birth_control_device_implanted='+question1+'&Were_you_or_a_loved_one_injured_by_a_BROKEN_ParaGard_at_any_time='+question2+'&In_what_year_was_the_ParaGard_implanted='+question3;";
}
else if((question1 == "No") || (question2 == "No") || (question3 == "Before 2002")){
window.module.lp.form.data.url = "https://get.paragardlawyers.com/sorry/";
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment