function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Disable to button after first click for upto 4 hours

I have a button which executes the Javascript on the case objects. Basically what it does is it escalates the case. But the problem is user can click it repeatedly and cause lot of cases/alerts generated. 
We want to limit user to wait for atleast 4 hours after the first click. Here is the javascript behind this button. How can I add a counter of 4 hours to this. 
function requireCssFile(filename)
var fileref = document.createElement('link');
fileref.setAttribute('rel', 'stylesheet');
fileref.setAttribute('type', 'text/css');
fileref.setAttribute('href', filename);
var j$ = jQuery.noConflict();
var iframe_url = '{!URLFOR("apex/CustomerEsc?id=")}{!Case.Id}';
var child_domain = iframe_url.substring(0, iframe_url.indexOf('/', 9));
var parent_domain = window.location.protocol + '//' +;
var j$modalDialog = j$('<div id="opppopup"></div>')
.html('<iframe id="iframeContentId" src="' + iframe_url + '" frameborder="0" height="100%" width="100%" marginheight="0" marginwidth="0" scrolling="yes" />')
autoOpen: false,
title: 'Escalate Case',
resizable: true,
width: 850,
height: 605,
autoResize: true,
modal: true,
draggable: true



VinayVinay (Salesforce Developers) 

Review below link that can help you.

Vinay Kumar