PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

open redirected page in new window

  1. mattswan
    Member

    Hello!

    what I want to do is when form is submitted it is being redicted to some page, so how I can open that redicted page into new window and not on same page?

    Thanks.

    Posted 13 years ago on Wednesday January 19, 2011 | Permalink
  2. The form still has to submit to the page and either show the inline confirmation text, or redirect via javascript directly after to the new page. There's no easy way to change the target on the redirect and I'm honestly not sure of many occasions you would need to. You could always add a popup script in the confirmation text field (accepts HTML) to launch a new page, but you will probably run into problems with popup blockers.

    Not sure what you're trying to achieve, but you could always use some jQuery to create an inline popup confirmation box. Here's an older post with an example.

    http://forum.gravityhelp.com/topic/confirmation-via-pop-up-box

    Posted 13 years ago on Wednesday January 19, 2011 | Permalink
  3. mattswan
    Member

    I want is just target="_blank" attribute and I dont think I want to use jquery for that.

    Posted 13 years ago on Thursday January 20, 2011 | Permalink
  4. mattswan
    Member

    Hi Kevin,

    I found some solution from your othere post reply, it's as bewlo, but the problem is we are using multisite fuctionality and form id is different for different site.

    our site link is http://www.constellationhotels.com.au and I am talking about the book now form which resides on header image area.

    it is being used in all of our sites but with different Ids so what can I do?

    <script type="text/javascript">
    	jQuery(document).ready(function() {
     		jQuery("#gform_XX").attr("target", "_blank");
    	});
     </script>

    Thanks.

    Posted 13 years ago on Thursday January 20, 2011 | Permalink
  5. If you want to use that script to apply to all of your Gravity Forms, you wouldn't add the attribute by targeting the form ID, but instead target any form element wrapped in the the "gform_wrapper" class.

    <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery(".gform_wrapper form").attr("target", "_blank");
    });
    </script>
    Posted 13 years ago on Thursday January 20, 2011 | Permalink
  6. travin
    Member

    I am using this code above that script in the header file:

    <?php wp_enqueue_script("jquery"); ?>

    Posted 13 years ago on Saturday March 5, 2011 | Permalink
  7. travin
    Member

    Nevermind, I figured it out. I was calling the script before the wp_head.

    Posted 13 years ago on Saturday March 5, 2011 | Permalink
  8. Okay, glad you figured it out. Thanks for the update.

    Posted 13 years ago on Saturday March 5, 2011 | Permalink
  9. I am using a form within a fancybox frame. I would like the confirmation page to be a normal fullwidth thank you page. I tried using your script in the header.php file but the new page loads blank.

    [js]
    <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery(".gform_wrapper form").attr("target", "_blank");
    });
    </script>

    It seems simple enough. I just want the Confirmation Redirect url to use target="_blank" or target="_top"....

    FYI, I did not use this: <?php wp_enqueue_script("jquery"); ?>

    Perhaps I am missing something? Any ideas? Any help would be great. Thanks.

    Posted 12 years ago on Tuesday January 10, 2012 | Permalink
  10. FYI, the script is pops up a new blank page but the URL is incorrect. Instead of leading to the thank you page, it goes to the url where the form is located with #gf_19 at the end.

    Example:
    http://www.example.com/form-page#gf_19

    Posted 12 years ago on Wednesday January 11, 2012 | Permalink
  11. Can you post a link to your form, and also show us your confirmation settings, including the URL, and any other custom code you may be using? Thank you.

    Posted 12 years ago on Wednesday January 18, 2012 | Permalink