• Resolved dougjoseph

    (@dougjoseph)


    Hello! Thanks for such a great plugin.

    We have a need to redirect the user to another tab on same page upon completion.

    i.e. we need to switch user from:

    https://www.SOMESITE.COM/petition/#tab-1

    …to:

    https://www.SOMESITE.COM/petition/#tab-2

    …upon completion of signing the petition.

    Can anyone offer any tips or suggestion for where to begin on getting this to happen?

    By the way, for anyone reading this who is involved in work with non-profit organizations, the concept it to place a petition on one of three tabs, an online donation form on a second of three tabs, and a social sharing box on the third tab.

    I will aim to report back here any solution I can find, or how I’m able to make out with any suggestions offered.

    • This topic was modified 6 years, 6 months ago by dougjoseph.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author SpeakOut!

    (@123host)

    I like the idea of being able to add a custom return page. I will look into it, but I am pretty busy on some projects at the moment.

    Thread Starter dougjoseph

    (@dougjoseph)

    Thanks. Here’s one approach that allows it to be done with the Contact Form 7 plugin:

    https://contactform7.com/redirecting-to-another-url-after-submissions/

    Here’s a copy and paste from the meat of it:

    The simplest way is utilizing Contact Form 7’s custom DOM event to run JavaScript. The following is an example of script that redirects you to another URL when the wpcf7mailsent event occurs:

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

    Embed this snippet into your theme’s template file. Obviously, you need to replace the https://example.com/ in the code to the URL you want to redirect to.

    Thread Starter dougjoseph

    (@dougjoseph)

    Of course, being able to simply input a URL into a field, to serve as a custom return page, would be a great solution as well.

    Plugin Author SpeakOut!

    (@123host)

    Yep, that is my plan ;o)

    But…opening a different tab on a page isn’t as simple as going to #tab2 – that is what is known as an anchor and will go to a specific point on a page, but that is different to opening a tab. You should be able to test that on the actual page to see if you can open the tab with a URL…if you can already do that, please show me the page and the URL.

    If your URL was https://example.com/mypage and you entered https://example.com/mypage?tab2 you would then need to use something like javascript to tell the page to bring tab 2 to the front.

    Just want to be sure you are aware of that.

    Thread Starter dougjoseph

    (@dougjoseph)

    I think you may be correct on that! I had not considered it.

    I am using the Avada theme’s built in tab feature on this page:

    https://www.wvforlife.org/petition/

    Tab 1 shows a URL of https://www.wvforlife.org/petition/#tab-628c2f767a61f819a40

    Tab 2 shows a URL of https://www.wvforlife.org/petition/#tab-1d7c2b8ed67176a8898

    Tab 3 shows a URL of https://www.wvforlife.org/petition/#tab-3b8a623851426b83c9c

    Whenever I visit those URLs directly, I get taken to the correct tab.

    However, I think I really need a quick switch, rather than a hard reload of the page.

    Whenever I click on one of the tabs with the mouse, I get a quick switch, not a reload of the page. I’m in hopes of replicating that behavior on completion of signing a petition.

    I’m definitely not averse to use of Javascript. I just know that the result has be something that can be easily replicated for instance after instance in subsequent petition pages (with their own donation tab and sharing tab).

    The knowledge of how to accomplish this, seems to be beyond my current level. I am hopeful to learn. Thanks for the heads up!

    • This reply was modified 6 years, 6 months ago by dougjoseph.
    Plugin Author SpeakOut!

    (@123host)

    I am not sure whether or not you understand that Javascript is a client side language i.e. it is not run on the server, but on the viewer’s device.

    This means that any javascript in the theme that controls tabs needs to be included at the theme level not the plugin.

    Given that you are planning to put the plugin in one of the tabs we can assume that the code exists – or you wouldn’t be able to switch tabs, regardless of the content on them.

    But the click that changes tabs is on the tab itself, this tells the browser to switch to that tab. Unfortunately that is not going to be possible in the plugin without a page reload. Actually…it might be possible if _everyone_ was using the same theme, but to make it work across all themes would be pretty much impossible.

    I will still consider having the ability to load a new page, but that will be the best I can do I think.

    Thread Starter dougjoseph

    (@dougjoseph)

    I’m very familiar with what Javascript is. ??

    The rest of the reply is very helpful consideration.

    I would like to second this suggestion. After the user completes the petition, it would be helpful if he or she could be directed to a specific URL (e.g. a donation page, a “learn more” page, etc). It would also be helpful if he or she could see a message (e.g. “thank you, here’s what else you can do”).

    Thirding this suggestion. I’d love to have the ability to redirect users to a custom thank you page after signing.

    Plugin Author SpeakOut!

    (@123host)

    Sorry…this had dropped off my radar.

    I will try to get to it soon, but my life circumstances have changed a lot over the last month. I won’t be abandoning the plugin, but some other things are higher priority for now.

    Thread Starter dougjoseph

    (@dougjoseph)

    Thanks. I think everyone understands. I certainly do. Thank you for such a helpful plugin.

    Thread Starter dougjoseph

    (@dougjoseph)

    Just your interaction here has helped me think things through more thoroughly than I had prior to it.

    In order to get the speedy behavior I’m after, I need to create a custom page template and embed a Javascript in it, such that it will facilitate the kind of quick “tab switch” I’m after.

    Given that the right kind of actionable web hooks are accessible, it’s doable. If the hooks are not accessible, we’d have to look into a custom coded everything, so to speak.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Redirect on completion of signing petition’ is closed to new replies.