Viewing 15 replies - 1 through 15 (of 15 total)
  • RE: I’m getting some sort of jQuery error but not sure whether this is affecting the form.

    Any jQuery error is likely to stop on_sent_ok working which will stop your page from redirecting.

    See Contact Form 7 Email Issues – there is a link there that covers Javascript Conflicts.

    See http://wiki.simple-press.com/installation/troubleshooting/plugin-conflicts/ for general guidance.

    Hey guys,

    I wanted to put my mustard in here as I had the same issue. First of all this is ridiculous – such an issue for such a popular plugin. It is defintely not related to a jQuery issue as there a hundreds of threads out there with users having the same issue over a short period of time and it seems by using a latest version of the plugin.

    I tried a solution found here all the way at the bottom: http://wordpress.org/support/topic/contact-form-7-redirect-not-working

    It works. I don’t understand why suddenly adding the ‘on_sent_ok’ js snippet does not work anymore when adding it to additional headers and the solution as mentioned ion this thread is to me a hot fix.

    Please fix this properly as soon as possible as it sucks.

    cheers

    Thread Starter Jimladen

    (@jimladen)

    Thank you for the replies

    The jQuery error is actually coming from the scripts.js file in the contact form 7 plugin. The error appears when a message is sent successfully.

    Uncaught SyntaxError: Unexpected token:

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

    the unexpected token is the ‘n’ on the eval(n) apparently

    Any suggestions on how I could possibly remove/fix this?

    Thanks

    @simsalabim – I expect you won’t be at all interested to hear this but hopefully others reading this post will at least question the accuracy of your assertions.

    I do a lot of support in this forum and have seen the on_sent_ok not redirecting issue frequently reported over a long period. In each and every post that I have been involved with, the problem has been caused by a Javascript Conflict on the particular WordPress install – either the theme, another plugin or Javascript added by the user.

    I should add that on_sent_ok is redirecting for me on many several websites and a couple of different servers – just as it has done for some time.

    Javascript Conflicts are unfortunately a fact of like with WordPress and a common problem for all popular plugins that use Javascript. Unfortunately most to the popular WordPress plugins are frequently blamed for problems when the real cause is a Javascript Conflict created by the theme or another plugin.

    Thread Starter Jimladen

    (@jimladen)

    @buzztone

    Thanks for your input, however in this particular scenario the jQuery error is coming from the scripts.js file within the contact form 7 plugin folder.

    @buzztone I used on_sent_ok on over 20+ occasions too on many WordPress versions and never had this issue. My error logs including developer tools don’t give me any js errors. By the way – if you would look at the solution I posted via the link – you would see that actually the javascript woks but by adding it directly after the the posted OK message. Said that, it rectifies my assumption that is NOT a jquery or javascript issue as in that case the following solution would not work either.

    Correct me if I am wrong. I am open for constructive feedback.

    cheers

    @jimladen – the error is showing you where CF7’s Javascript is failing – it doesn’t necessarily show the cause.

    Remember that a problem in one script can cause issues in another.
    For example, some jQuery errors can stop jQuery processing any more script, which can make the culprit hard to find.

    Thread Starter Jimladen

    (@jimladen)

    @buzztone That is a fair point however, there are no other jQuery errors on the page.

    @simsalabim – I did try that script solution you referred to in your previous comment and it hasn’t worked for me but thank you for the suggestion.

    RE: That is a fair point however, there are no other jQuery errors on the page.

    Lack of errors and errors showing a symptom rather than the cause is unfortunately more commonly the case than not.

    See http://wordpress.org/support/topic/redirect-stopped-working for an example of no errors but where an educated guess found the problem quickly.

    @jimladen I don’t think this solution will help you you are better off checking out what @buzztone suggested. My issue also refers to the same topic however I believe it’s a different kind of error source.

    I tested your form. I get a error message “Uncaught syntax error: Unexpected token Illegal”. Also some warnings. Go on the bottom of that error there might be a connection.

    Thread Starter Jimladen

    (@jimladen)

    Hi Guys,

    Just removed the captcha form and and the redirect is working properly now so am assuming there was a problem with the captcha.

    Thank you for all your suggestions.

    Thread Starter Jimladen

    (@jimladen)

    Okay so I have the final resolution.

    It wasn’t the captcha form after all. I was missing a ” at the end of the code…

    on_sent_ok: “location = ‘http://www.wordtrans.com/quote-success-page/’;”

    It’s always the simple things eh?

    thanks for your help guys really appreciate it.

    i get success for this code

    remove your full url only write short term

    on_sent_ok: “document.location=’?page_id=345′;”

    on_sent_ok: “document.location=’/step-2/’;”

    The ‘From address’ shows my default site address instead of ‘ [email* your-email]’ address. Please how can I change this, because it makes my mail auto-respond not to work

    We found this issue on a client site and were given direction to solve it. I followed a number of recommendations including the plugin author’s which essentially is: another plugin is causing this problem. I turned off all plugins except CF7 and it still did not work. I tried redirecting via script after “message sent” and that also did not work. The problem was with a plugin, like the author suggested, but the plugin did not appear in the plugin list to be disabled. Advanced Cache had been installed and then removed incompletely. I installed the plugin and then unistalled it in order to have it completely removed. Problem solved.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘On_sent_ok not redirecting’ is closed to new replies.