在相同的弹出窗口中显示 "Thank you message" window 在具有重力形式的 Magnific 弹出窗口中

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

我想在表单提交后继续在同一个 Magnific 弹出窗口 window 中显示 "Thanks for contacting us! We will get in touch with you shortly." 消息。提交表单后 window 关闭。我使用的代码:

<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>

如果您设置了"ajax"参数,将只刷新表单标记而不是整个页面。

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