Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using CF7 to send some information to my email and everything's working fine, but I need to redirect the users to a different page after the email has been sent, by default the forms are sent to the same page via ajax, I was thinking about setting a hidden field with the page url but since the form submits asynchronously I don't know how to set it in my page template. If the form was submitted normaly I'd do something like:

if (isset($_REQUEST['hidden_field_url']) {
    wp_redirect($_REQUEST['hidden_field_url']);
} 

So is there any way to send the form without ajax? Or maybe do what I need in any other way?

Thanks in advance!

share|improve this question
add comment

2 Answers

In your jQuery AJAX call you should add some javascript to redirect the page:

window.location.replace("http://wordpress.stackexchange.com");
share|improve this answer
    
Got it, I posted it as and answer below. –  javiervd Apr 9 '11 at 21:21
add comment
up vote 2 down vote accepted

Got it, needed to add this to the additional settings option:

on_sent_ok: "location = 'http://www.url.com';"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.