Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

adblastbiz on "contact form 7 conditional redirect"

$
0
0

It took me to days of research and mostly trial and error until I got the conditional redirect for drop down options to work the way I wanted it. The example is for 2 different options in the drop down and then your otherwise main page you want people directed to if these two options are not picked. You can follow the pattern to add as many options as you want. I tested in chrome, ie, and ff... all work fine. I know many of you need this. pat on the back will be good enough. thanks. lol

replace youridnamenospaces with your form id and your drop down value spaces ok with what ever your full drop down value is.
http://yoururl.com/page1/ .... /page2/ with your pages as well as yoururl.com/page0/' with what ever page you would otherwise want people to land on.... cheers :)

on_sent_ok: " if (document.getElementById('youridnamenospaces').value=='your drop down value spaces ok') location = 'http://yoururl.com/page1/'; else if (document.getElementById('sameidnamenospaces').value=='your drop down option #2 spaces ok' ) location = 'http://yoururl.com/page2/'; else location.replace('http://yoururl.com/page0/');"


Viewing all articles
Browse latest Browse all 8245

Trending Articles