Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Conditional forwarding based on drop-down

$
0
0

Replies: 0

Hi guys,

I’m trying to work out how to forward a contact form depending on the visitors selection from a drop down.

Here’s the code I have in the Additional Settings :

document.addEventListener( ‘wpcf7mailsent’, function( event ) {
if {

var lpLocation = document.getElementById(“lpLocation”).value;

if (lpLocation == “Facebook”) { location = ‘http://facebook.com/’; }
else if (lpLocation == “Google”) { location = ‘http://google.com/’; }

}
}, false )

And here’s what I have on my form

[select* location id:lpLocation “Facebook” “Google”]

The form sends the email but it’s not forwarding and I can’t quite figure out why it’s not working.

Can you help?

thanks


Viewing all articles
Browse latest Browse all 59525

Trending Articles