Gravity forms confirmation display in popup Here is my solution :

you need to add a custom template with this code  for your gravity forms page.  gravity forms  Confirmation  will Page Redirect Redirect URL will your form page url and Redirect Query String will “confirm=1″  you can change this value with you parameter

and change your function  also   Thank you!

Now its easy for you to display ” Gravity forms confirmation in  popup modal”  this is best and easy way for Gravity forms notification display in popup

<style>
/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin-top: 8%!important;
    margin-left: 27% !important;
    border: 1px solid #e2e2e2;
    width: 50%;
    position: fixed;
    z-index: 9999;
    margin: auto;
    padding: 25px;
    border-radius: 5px;
    min-width: 200px;
    font-size: 17px;
    line-height: 23px;
	box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    -webkit-animation-name: animatetop;
    -webkit-animation-duration: 0.4s;
    animation-name: animatetop;
    animation-duration: 0.4s
}
.modal-header h2 {
    border-bottom: 2px solid #E2e2e2;
    margin-bottom: 20px;
}

/* The Close Button */
.close {
    color: #aaa;
    float: right;
    font-size: 21px;
    font-weight: bold;
    position: absolute;
    right: -8px;
    top: -14px;
    border: 2px solid #e2e2e2;
    border-radius: 100%;
    padding: 0px 5px;
    background-color: white;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
/* Add Animation */
@-webkit-keyframes animatetop {
    from {top:-300px; opacity:0} 
    to {top:0; opacity:1}
}

@keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}
</style>

<!-- call the jQuery library if not already loaded in theme -->

<!-- the function to fade the confirmation text -->

<script type="text/javascript">
  $(document).ready(function(){
   setTimeout(function(){
  $("#gforms_confirmation_message").fadeOut("slow", function () {
  $("#gforms_confirmation_message").remove();
      });

}, 2000);
 });
</script>

<?php
	//show different request based on the query string value check the case
	$formconfirm = $_GET['confirm'];

		switch ($formconfirm)
		{

			case 1:
			echo '
<div id="myModal"><div class="modal-content">
<div class="modal-header">
<span class="close">&times;</span>
<h2>Thank you for your interest!</h2>
</div>
<div class="modal-body">
<p>Your request for more information has been submitted. A member of our sale team will be contacting you shortly 
to answer any question and provide more information on MicroBIZ Cloud POS/Inventory Management software.</p>
<p>We appreciate your interest in our product.</p>
<img src="https://wordpress.microbizcloud.com/wp-content/uploads/2017/06/logo-1.png" alt="" width="169" height="35" class="alignright size-full wp-image-29203" /></div>
</div></div>
<script>jQuery(document.body).on("click",".modal-content .modal-header .close",function(){
      jQuery(this).parent().parent().hide();
});
</script>';

			break;

			case 2:
			echo "<div id=\"gforms_confirmation_message\">Thanks for submitting the second form. We'll be back in touch with you soon.</div>";
			break;

			case 3:
			echo "<div id=\"gforms_confirmation_message\">Thanks for submitting the third form. We'll be back in touch with you soon.</div>";
			break;

		}
	?>
Leave a reply