Tag Archives: cf7 redirect form

WordPress

Redirect Users After Submitting Form, Contact Form 7

Today, I did one simple thing that i want to share with you guys. Its about Contact Form 7 redirection. if you want to redirect your users to a page when they click on submit button at contact page/other form. what you need to do? lets take a look. Its very simple.

First,

Login to your wp-admin go to contact form 7.  Click on edit and open up your desire form.

scroll your mouse and find additional setting option.

Second, Paste the below code their.

 on_sent_ok: "location.replace('http://yoururl.com/thank-you/');"

Hope it will work!

If not then don’t worry. You have to go complete another step.

Login to your Hosting Manager via  cPanel or via FTP. then go to /wp-content/plugins/contact-form-7/includes/js

After that open the file named script.js

find this code

if (data.onSentOk)
$.each(data.onSentOk, function(i, n) { eval(n) });

and replace this two line with,

if (data.onSentOk)
jQuery.each(data.onSentOk, function(i, n) { eval(n) });
if(document.location == "http://sitename.com/donations/"){
location.href="http://yoururl.com/thank-you/";
}

Its Finish!

Open your contact form 7 on browser and submit a test message it will send your message after that redirect you to the URL “http://yoururl.com/thank-you/” .

N. B : Change the URL’s with your desire URL.

 

Read More