soliddigital
soliddigital

Reputation: 306

Show "Thank you message" in same popup window in Magnific popup with gravity forms

I want to keep showing "Thanks for contacting us! We will get in touch with you shortly." message in same Magnific popup window after form been submitted. At the moment after form been submitted window closes. Code I using:

<script>
  jQuery(function ($) {
    $('.open-popup-link').magnificPopup({
      type: 'inline',
      closeOnBgClick: false,
      fixedContentPos: true,
      closeOnContentClick: false
    });
  });
</script>
  .white-popup {
    position: relative;
    background: #FFF;
    padding: 20px;
    width: auto;
    max-width: 500px;
    margin: 20px auto;
  }
<div id="test-popups" class="white-popup mfp-hide">
  Popup content
  <?php echo do_shortcode('[gravityform id=4 title=false description=false]'); ?>
</div>
<a href="#test-popups" class="open-popup-link">Contact Us</a>

Upvotes: 0

Views: 832

Answers (1)

Dave from Gravity Wiz
Dave from Gravity Wiz

Reputation: 2859

If you set the "ajax" parameter, only the form markup will be refreshed rather than the whole page.

[gravityform id="4" title="false" description="false" ajax="true"]

Upvotes: 1

Related Questions