0
votes

Hello i need to know how to refresh the page after i submit an ajax form. Atm i'm using an onClick function it seems it refreshes the page but i still need to press f5 to see the changed i made.

js:

 <script>
    function reloadPage()
      {
      location.reload()
      }
    </script>

form:

echo'<form class="imageform" method="post" enctype="multipart/form-data" action=\'clase/app/admin_activare_oferta.php\'>';
echo'<input  type="hidden" name="id_oferta"  value="'.$oferta.'">';
echo'<input type="submit" id="activ" value="" onclick="reloadPage()"></form>'; 

I know why i need to press on the button twice to see the change, because i need to run that refresh after ajax submits.

2
It doesn't seem like an AJAX form to melinepogl
Just use document.location.reload(true)nanobash
i didnt post the script for it, it is an ajax formSima Cristian Alexandru
not working DaHaKa i need to press the subbmit button twice to see the changeSima Cristian Alexandru
Why would you want to reload the page? The whole idea of AJAX is that you don't have to reload the page anymore.Nic Wortel

2 Answers

0
votes

In IE you should use window.parent.location.href