Conditional Redirects based on Different values.
-
Hey,
I have a question regarding the excellent work of MarkyMark with regards to Redirects in Contact form 7.
He has a script (which works) based on one value:
on_sent_ok: ” if (document.getElementById(‘citytype’).value==’medellin’) {location.replace(‘https://www.google.co.uk’)} else { location.replace(‘https://uk.yahoo.com/’) } “I need to expand this. But have no idea how. So i have two elements, the first is ‘Citytype’ and the second ‘Secondcitytype’ Each element has 3 cities. The cities for both are medellin, bogota and cartagena.
What I need the form to do is prompt different URL for each possible combiantion. So:
(‘citytype’).value==’medellin’) AND (‘secondcitytype’).value==’medellin’) THEN specific url.
(‘citytype’).value==’medellin’) AND (‘secondcitytype’).value==’bogota’) THEN specific url.
(‘citytype’).value==’medellin’) AND (‘secondcitytype’).value==’cartagena’) THEN specific url.And so on. There will be many combinations each prompting a different URL.
There will be no need for ‘else’ because all combinations will be filled.How to write such script, how to add the two?
Would love to get this to work.Thank you so much in advance!
Regards,
Robert
- The topic ‘Conditional Redirects based on Different values.’ is closed to new replies.