Contact Form 7: Redirecting on a condition in Additional Settings

Redirecting without a condition When you use the WordPress plugin “Contact Form 7” you can redirect the user to another page after submitting the answers by the following code:

on_sent_ok: "location.replace('');"

Redirecting on a condition If you want to make the redirecting depending on a specific answer, you can use the following code:

on_sent_ok: " if (document.getElementById('type').value=='yes') 
} else { location.replace('') }"


on_sent_ok: "var Iso = $("input[name=radio-option]:checked").val() ; 
if(Iso == 'General enquiry' ){ location = '/contact/enquiry/thank-general-enquiry/'; } 
if(Iso == 'Special enquiry' ){ location = '/contact/enquiry/thanks-special-enquiry/'; } 
if(Iso == 'Interest enquiry' ){ location = '/contact/enquiry/thanks-interest-enquiry/'; }"


Popular posts from this blog

Set limit wp_nav_menu

Conut document have children that are show in navigation