Using magnific popup type ajax in form Submit

Using magnific popup type ajax in form Submit

I have a question. I am not much aware of javascript. I want to open a new page (showresults.asp) with all form data transferred to, using magnifique popup Type Ajax. The new window should open on pressing the form Submit (Send) button.

I saw the following code in another post, it needs some modification for the requirements mentioned above. The link to post page is:

  1. <html>
    <script src=""></script>
    <script src=""></script>

       <link rel="stylesheet" href="">
    .white-popup {
      position: relative;
      background: #FFF;
      padding: 20px;
      width: auto;
      max-width: 500px;
      margin: 20px auto;
    #popup {
        visibility: hidden;    

                <form method="post" name="index" id="indexform">
                <input type="text" name="name" placeholder="NAME"><br/>
                <input type="text" name="email" placeholder="EMAIL"><br/>
                <textarea rows="3" name="message" placeholder="MESSAGE">       </textarea><br/>
                <input name="sendData" type="submit" value="SEND">
                <button  type="submit" id="popup" class="popup-modal" href="#modal-results">Popup</button>               
                <div id="modal-results" class="white-popup mfp-hide">
                <p><a class="popup-modal-dismiss" href="#">Dismiss</a></p>
                <script type="text/javascript">
                    $("#indexform").submit(function(event) {
                    var formdata = $(this).serialize();
                        type: "POST",
                        url: "result.php",
                        data: formdata,
                        success: function(msg) {
                        error: function() {

                    }).done(function() {
                            type: 'inline'