Jump to content

Refresh frame after form submit


reece

Recommended Posts

Hey.

 

I am trying to make a frame on my page refresh after a form has been submited, but at the moment it is just ingnoring the script and not refresh the frame.

 

The script is

 

<script type="text/javascript">
    window.onload = function()
    {
      <?php
        if(isset($_POST['submit'])) {
          echo 'parent.mainFrame.document.location.reload();';
        }
      ?>
    }
</script>

 

Any help would be appreciated. :)

Link to comment
https://forums.phpfreaks.com/topic/164959-refresh-frame-after-form-submit/
Share on other sites

Okay, then you might have a logic issue...

 

This code is going to run on page load, which would mean that the submit button would have to be set in php when the page is loaded, it is not going to be set until the button is clicked so your if statement is not going to ever be true.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.