• hi there a question … i read about that on_sent_ok will be deprecated … and i can use a script like this:

    <script>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    location = ‘https://example.com/&#8217;;
    }, false );
    </script>

    and i put this code in my admin theme panel in extra javascript … and working ..

    but … with code on_sent_ok in each of my form i sent my customer to different thank you page … now with the script is not possible?

    suggestions?

    best regards

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi,

    I have following code in the addtional setting of Contact Form

    on_sent_ok: “location = ‘https://www.exampel.com&#8217;;”

    and would like to know, how does the code look like in function.php.

    Please notice, that I am not a developer.

    Thanks

    Thread Starter maximiliano

    (@maxidg)

    Hi @aozcorap,

    me too, but that code at the end of 2017 will be deprecated … so you must change the rule … i mean for me i put this code:
    <script>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    location = ‘https://example.com/’;
    }, false );
    </script>
    in my admin theme panel extra java script and working well … but my question is another.

    I hope that can help you.

    where exactly did you put it in the admin theme panel?

    Thread Starter maximiliano

    (@maxidg)

    it’s depend which theme you have? is a free theme or commercial?

    it’s a commercial one.

    Elegant Themes

    I added in the <head> following code:

    <!– Contact Form Code redirect to URL after Submit –>
    <script>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    location = ‘https://www.example.com&#8217;;
    }, false );
    </script>
    <!– END: Contact Form Code redirect to URL after Submit –>

    Thread Starter maximiliano

    (@maxidg)

    ok in head of which php page? becarefull if you put the code in the function.php when u update the theme you lost the code …
    so i think is better to look your theme admin panel and search for custom css and custom java script and u can put there the code … ??

    see u

    This is very strange to be honest.

    I added the code
    <script>document.addEventListener( ‘wpcf7mailsent’, function( event ) {location = ‘https://www.personal-training-mittelhessen.de/confirm&#8217;;}, false );</script>

    in the theme admin panel where I can insert scripts in the head of the page. This area contains also the facebook pixel code.

    But if I add the code just below the facebook pixel code, it does not work.

    Thread Starter maximiliano

    (@maxidg)

    first of all i hope that you write like in my example .. i mean in different line … second … if not work try to put before ..

    hmhmh … ??

    Yes, the code is as following

    <script>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    location = ‘https://www.example.com’;
    }, false );
    </script>

    and I added it right before the Facebook Pixel code, but still does not work ??

    Thread Starter maximiliano

    (@maxidg)

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘ON_SENT_OK code deprecated’ is closed to new replies.