title: submit form and display form results using magnific-popup
body: <p>I'm using Magnific Popup. Within the popup I have a form.  On form submit, I would like to display text from the php form processing file. Right now the page just refreshes and not sure what it's hanging on.</p>
  
  <pre><code>&lt;form name="subscribe" id="subscribe" class="subscribe" action=""&gt; 
     &lt;p&gt;&lt;input name="subscribe" type="checkbox" value="yes"&gt;text here&lt;/p&gt;
     &lt;input name="submit" type="submit"  value="Submit"&gt;
  &lt;/form&gt;
  
  &lt;?php 
  echo "thanks";
  ?&gt;
  
  &lt;script type="text/javascript"&gt;
  (function($) {
      // open the popup
      $(window).load(function () {
          $.magnificPopup.open({
              items: {
                  src: '#my-popup',
                  type: 'inline'
  
              },          
            //add options here, 
                  closeOnBgClick: false,
                  closeOnContentClick:false
  
          }, 0);
      });
  
      // close the window no thanks button
      $('#button').click(function() {
          $.magnificPopup.close(); 
      });
  
      // submit form and show results text
      $('#submit').click(function() {
        $.ajax({
             type: "POST",
             url: test.php,
             data: $("#idForm").serialize(), 
             success: function(data)
             {
                 alert('ok');
                 alert(data); // show response from the php script.
             }
           });
          });
  
  
  })(jQuery);
  &lt;/script&gt;
  </code></pre>