Update a parent div using javascript
<p>So I have several modal windows on my site. I usually use jquery and ajax to accomplish something in the modal window and to update a div on the parent page. </p>

<p>My problem here is I'm uploading files so I'm forced to use an iframe which I never do and Im using javascript, not jquery which I never do, so I'm a little lost and looking for some direction. </p>

<p>I'm trying to update a div on the parent page from my modal window. In the modal window I have a form which targets an iframe and the action is directed at a separate php page. The overall question is how do I send an updated $attachment_table to a parent div after the form has uploaded its files? I'm trying:</p>

<p>Modal_window.php - has a form on it that uploads files.</p>

<pre><code>&lt;?php
$attachment_table = '';
while (($row73 = $answer17-&gt;fetch(PDO::FETCH_ASSOC)) !== false) {
                          $attachment_table .= '&lt;tr&gt;';
                          $attachment_table .= "&lt;td&gt;&lt;input name='checkbox[]' type='checkbox' id='checkbox[]' value='${row73[imageven_id]}'&gt;&lt;/td&gt;";
                          $attachment_table .= "&lt;td&gt;&lt;a href='../php/viewimages.php?id=${row73[image_id]}')'&gt;${row73[upload_name]}&lt;/a&gt;&lt;/td&gt;";
                          $attachment_table .= "&lt;td&gt;${row73[image_category]}&lt;/td&gt;";
                          $attachment_table .= "&lt;td&gt;${row73[upload_date]}&lt;/td&gt;";
                          $attachment_table .= '&lt;/tr&gt;';
                      };

?&gt;    

&lt;script type="text/javascript"&gt;

        function stopUpload(success) {
            var result = '';
            if (success == 1) {
                window.top.document.getElementById('attachment_table').innerHTML = &lt;?php echo $attachment_table; ?&gt;;
                document.getElementById('result').innerHTML = '&lt;div class="msg-status" style="width:492px;"&gt;The file was uploaded successfully!&lt;\/div&gt;&lt;br/&gt;';
            } else if (success == 0) {
                document.getElementById('result').innerHTML = '&lt;div class="msg-error" style="width:492px;"&gt;There was an error during file upload!&lt;\/div&gt;&lt;br/&gt;';
            } else if (success == 2) {
                document.getElementById('result').innerHTML = '&lt;div class="msg-error" style="width:492px;"&gt;ERROR! Please upload a document with the following file types....&lt;br/&gt;&lt;br/&gt;txt, doc, xls, rtf, ppt, pdf, jpg, jpeg, gif, png, xlsx, docx, png, pps, ppsx, ppt&lt;\/div&gt;&lt;br/&gt;';
            }
            document.getElementById('f1_upload_process').style.visibility = 'hidden';
            return true;
        }
    &lt;/script&gt;
</code></pre>

<p>modal_window_process.php - Processes database code and sends response which is $result</p>

<pre><code>&lt;script language="javascript" type="text/javascript"&gt; 
window.top.window.stopUpload(&lt;?php echo $result;?&gt;);
&lt;/script&gt;
</code></pre>

<p>Can someone point me in the right direction please? I couldn't find anything on the web on how to do this and I'm a self taught noob. Thx.</p>
