0

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!

2 Answers 2

3

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

on_sent_ok: "location = 'http://www.url.com';"
2

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

window.location.replace("http://wordpress.stackexchange.com");
1
  • Got it, I posted it as and answer below. Commented Apr 9, 2011 at 21:21

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