spencerjw
Member
Posted 2 years ago #
This seems to be an ongoing issue. I have this in my Additional Settings field:
on_sent_ok: "location.replace('http://www.MyDomain.com/thank-you/');"
Where MyDomain is obviously switched out. This however is not working, all I get is the standard Green Box with the text in it saying my form has been submitted properly and it is not redirecting to my Thank You page at all.
I am on the latest 2.8.5 and have the latest version of the Contact Form 7 plugin.
I was also not able to get the hack to work using the edit directly to the .js file either.
RyanOrrock
Member
Posted 2 years ago #
***People having problems***
on_sent_ok: "location.replace('http://www.MyDomain.com/thank-you/');"
<\code>
Really works.
If it doesn't: make sure you are not using these fancypants characters for the quotes that the comments field changes:
on_sent_ok: “location.replace(’http://yourdomain.com/thank-you/’);”
You see how these are slanted? (the one above should be straight)
Type the whole line manually by hand to make sure you don't have "cool formatted quotes" or "custom apostrophes" and it will work.
muymalestado
Member
Posted 2 years ago #
Well; I sure wished this would work!
clickbridge
Member
Posted 2 years ago #
It works fine for me.
Try copying from above, pasting into notepad and then copying again into the additional settings with the correct full path to your thank you page.Going via a text editor will remove underlying word or other formatting.
Hope that helps!
rosebean
Member
Posted 2 years ago #
I tried to manually type it in and it still doesn't work for me!! I'm using WordPress 2.8.6 and Contact Form 2.0.7
For me the on_sent_ok: "location.replace('http://yourdomain.com/thank-you/');" works on two contactforms, but not on the 3rd one. Very weird and I cannot find out what is different from the other two.
I am using it on different subdomains with different languages.
The two forms where it works nicely go to the thankyou URL, the one where it doesn't work however goes to this URL:
http://www.domain.com/#wpcf7-f3-p101-o1
anyone experiences that and has a solution?
@senlin it means that Contact Form 7’s JavaScript is not functioning on the 3rd site.
Why isn’t My AJAX Contact Form Working Correctly?
Thanks for your answer, but that would be strange as it's all within the same site:
Working:
http://www.domain.com/order/ redirected to http://www.domain.com/order/confirmation/
nl.domain.com/bestel/ redirected to nl.domain.com/bestel/bevestiging/
Not working:
es.domain.com/pedir/ redirected to es.domain.com/pedir/confirmacion/ but instead getting es.domain.com/pedir/#wpcf7-f3-p101-o1
Nevertheless, I checked all the options in the post you are referring to, but everything is the same and the HTML of the page validates.
Perhaps it is an idea to give you the URL?
es.dreamytales.com/pedir/
@senlin JavaScript file is not loaded. That is the cause.
OK, that is a start.
but how come that the Javascript loads on the other two pages and not on the spanish one?
It is the same site and the spanish pedir page is just a WPML translated page of the other two pages...
OK, I solved it with a "dirty hack" in the footer. Will ask the guys over at WPML whether the problem is there...
Thanks for all the support and pointing me in the right direction!
njs1970
Member
Posted 2 years ago #
The "on_sent_ok" solution worked for me: WP 2.8.6 and CF7 2.0.7
Just copied and pasted the quoted line in RyanOrrock's post above.
Huge amounts of karma points for wordpress_dude ... :)
ajanini
Member
Posted 2 years ago #
Thank you takayukister!
Your answer to senlin solved my problem. My theme was missing the <?php wp_footer(); ?> in the footer.php file.
Problem solved.
Visioniz
Member
Posted 2 years ago #
just tried:
on_sent_ok: "location.replace('http://www.yourdomain.com');"
and it worked fine for me. (obviously the URL switched out. I'm using contact form 7, version 2.1.2 and wordpress version 2.9.1
However, I tried it 2 weeks ago on another form and it did not work. I updated wordpress in the mean time so it could be that?