call onto the parent page from html-form response in iframe
<p>I'm quite new to handling form input and responses, and I just ran into a problem how to process the server response.</p>

<p>I have a regular input form, that calls onto a php-file (submit.php) to process the submit. The <strong>submit.php</strong> is executed in an <strong>iframe</strong>, using <strong>curl</strong>.
(info: I can't use an ajax call because of some cross-domain issue)</p>

<p>I want to use the javascript bootstrap modal for displaying the thank you or error message after the form submit.</p>

<p>The form looks like this (simplified) with a response ready to be called on and the iframe I'm submiting the data to on the same page:</p>

<pre><code>&lt;form action="submit.php" method="post" target="iframeAnswer" id="formTest"&gt;
  &lt;input type="text" id="name" name="name" type="text" placeholder="your name here"&gt;
  &lt;button class="submitMe" id="submitButton"&gt;Submit&lt;/button&gt;
&lt;/form&gt;

&lt;div id="Modal" class="modal fade"&gt;
    &lt;!-- ... some html for the thank you pop up ... --&gt;
    &lt;!-- ... display set to none for the moment ... --&gt;
&lt;/div&gt;

&lt;iframe src="submit.php" name="iframeAnswer"&gt;&lt;/iframe&gt;
</code></pre>

<p>Now, I receive answer and process it. 
The return is Json, an array $response["success"] which is either true or false. In case of failure, it also contains an error array.
This is my response handling at the moment after processing the post data:</p>

<pre><code>$responseJson = json_decode($response, true);

if ($responseJson["success"] == false) {
    for ($i = 0; $i &lt; count($responseJson["errors"]); $i++) {
        // echo $responseJson["errors"][$i].' &lt;br /&gt;';
        // HOW to process this answer other than echo
    }
}
else if ($responseJson["success"] == true) {
        // echo "Thank you!"; 
        // What to do here to reach parent frame
    }
}
</code></pre>

<p>My Problem and <strong>where I'm a bit stuck is</strong>: 
I can now echo out a simple "thank you" in the iframe, but I would like to call on a Javascript (bootstrap modal) to have a bit of a nicer response. Or in general do something back in the page not in the iframe.</p>

<p>I'm not sure how to "go back" / "talk" to the page with the form from this place.</p>

<p>How can I call for example the javascript function below in the parent page with the form? Or actually any other function for that matter?</p>

<pre><code>jQuery("#Modal").modal('show');
</code></pre>

<p>I feel like I'm almost there but somehow I'm not connecting the last bits and pieces.</p>