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

put on hold as off-topic by birgire, kaiser yesterday

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

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
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

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