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.
1 Answer
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(){
location.reload();
}
-
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>"– djgibbsCommented Nov 25, 2016 at 20:42
-
can i call this method setTimeout(function(){ RefreshPage(); }, 3000); , inside a presaveitem() just before the line return true– dasarpCommented 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 2022Commented Dec 19, 2019 at 17:29