scripts – Contact Form 7 Redirect to different URL on form submit depending upon dropdown select


I’m utilizing this code for dropdown menu in Contact Form 7:

[select* menu-student id:menustudent include_blank "Student" "Professional"]

I need if one select Student, then after form submission, it will redirect to the scholar web page and if one select Professional, it will go to the skilled web page after form submission.

I’ve used this code as talked about right here.

This is the code I’ve added:

inputs = event.detail.inputs;
inputs.forEach( perform(el) {
    if ( el.identify == 'menu-scholar' ) {
        if ( el.worth == 'Student' ) {
        } else if ( el.worth == 'Professional' ) {

But it’s not redirecting for me.

Can somebody please level me the place I’m doing incorrect?

I’ve also used the below script with out any consequence:

document.addEventListener( 'wpcf7submit', perform( event ) {
  var lpLocation =  document.getElementById("menustudent").worth;
  if (lpLocation == "Student") {
    location = '';
  } else if (lpLocation == "Professional") {
    location = '';
}, false ) 

Any assist appreciated.

Source link

Leave a Reply