Refresh Form page after submitting the form?

15,795

Solution 1

window.location.reload()

should work

Solution 2

try something like:

$(document).ready(function() {
    $('#your_form_id').on('submit', function(evt) {
          evt.preventDefault();
          setTimeout(function() {
               window.location.reload();
          },0);
          this.submit();
    });
});

Solution 3

<form method="post" onsubmit="window.location.reload()">
<input type="submit" value='go' />
</form>
Share:
15,795
Sathya Raj
Author by

Sathya Raj

Developing....

Updated on August 12, 2022

Comments

  • Sathya Raj
    Sathya Raj over 1 year

    I use target="_blank" for my form submission to open the resulting page in new window but the previous or form page is still open and holding the values filled for form submission . If i click submit again it submits again with same values, so how would i refresh form page after submission.

    <form target="_blank" id="monthly_form" method="post" action="<?php echo base_url().'billing/monthly_slip'; ?>">
    ..form fields
    ...
    </form>