javascript - Contact Form 7 redirect page to specific URL based on drop-down selection -


my form needs open pdf on submit, pdf determined 1 of dropdown selections.

the dropdown download document (pdf).

upon clicking send, page open pdf on submission (preferably in new tab).

if not possible, redirecting appropriate pdf suffice.

can tell me how this, please?

my select dropdown so:

[select* menu-121 "spa track brochure" "three steps 100% control" "rfid pod range datasheet" "tray tracker datasheet"] 

and additional settings have following code:

on_sent_ok: "var pdfsub = $("select[name=menu-121]").val() ;   if(pdfsub == 'spa track brochure' ){     location = 'your-website1-url';  }  if(pdfsub == 'three steps 100% control ' ){     location = 'your-website2-url';  }  if(pdfsub == 'rfid pod range datasheet' ){     location = 'your-website3-url';  } if(pdfsub == 'tray tracker datasheet' ){     location = 'your-website4-url';  }" 

this should work in case:

on_sent_ok: "var pdfsub = $("select[name = menu - 121]").val();   if (pdfsub == 'spa track brochure') {     window.open(         'your-website1-url',         '_blank'     ); }  else if (pdfsub == 'three steps 100% control ') {     window.open(         'your-website1-url',         '_blank'     ); } else if (pdfsub == 'rfid pod range datasheet') {     window.open(         'your-website1-url',         '_blank'     ); } else if (pdfsub == 'tray tracker datasheet') {     window.open(         'your-website1-url',         '_blank'     ); } " 

Comments