Disable OK, Cancel buttons & Pop-up an alert on a SharePoint List Form

$(document).ready(function() {

 $(“input[value$=’OK’]”).css(“display”,”none”);
 $(“input[value$=’Cancel’]”).css(“display”,”none”);
alert(“The last date for leave encashment submission was 15th Feb 2012. You are not allowed to submit your leave encashment now.”);
});

Advertisements

Best practice to include a jQuery script on the SharePoint page

1) Save the jQuery script in a .js file
2) Upload the .js file to a document library
3) Include the .js file within script tags in a Content Editor webpart on the SharePoint page

<script>

language=”javascript”

type=”text/javascript”

src=”http://sharepoint/Shared%20Documents/jquery-1.6.3.min.js”>

</script>