I have a form in SharePoint. People can fill out this form. Once this form is completed its go sales department. In this form, there is a Cancel Request button that allows the user to cancel a request that is already filled in. I found out when users click on the Cancel Request button, they have a message telling them that the request will be canceled then nothing happen after. They have to manually refresh the page each time in other to complete the process. I would like to know how I can refresh the page automatically for 3 seconds when users click on the Cancel Button.

  • Should you post your current custom code ? Commented Nov 15, 2016 at 18:10

1 Answer 1


Below can get you started.

//bind the event with button click.....
    $( "#target" ).click(function() {
// ReferchPage() will be called after 3 seconds of button click.
        setTimeout(function(){ RefreshPage(); }, 3000);

// function call which will refresh page
    function RefreshPage(){
  • you just need to replace $( "#target" ) with your button id $( "#yourbutton id" )..... paste your html code which is getting generated for cancel button.... Commented Nov 25, 2016 at 20:19
  • am using this code: ="<a href='#' onclick=""Script.gestionItemCourant('"&NumDemand&",duplicate')"">"&" Duplicate</a>"
    – djgibbs
    Commented Nov 25, 2016 at 20:42
  • can i call this method setTimeout(function(){ RefreshPage(); }, 3000); , inside a presaveitem() just before the line return true
    – dasarp
    Commented Nov 5, 2018 at 14:00
  • This is the code to refresh page: <script type="text/javascript"> function refreshPage(){ location.reload(); } setTimeout(refreshPage, 60000); </script> #Read more: sharepointdiary.com/2016/05/…
    – SP 2022
    Commented Dec 19, 2019 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.