Posts

Showing posts from June, 2017

SharePoint 2013 "_spUserId" is undefined

_ spUserId is deprecated in SP2013. Use _ spPageContextInfo.userId instead.

SharePoint List : Check if the user has attached file

​​<script type="text/javascript" language="javascript"> function PreSaveAction() {     var attRow = document.getElementById("idAttachmentsTable");     if (attRow == null || attRow.rows.length == 0) { document.getElementById("idAttachmentsRow").style.display='none'; alert("Please attach the file. Attachment is mandatory"); return false ; } else { return true ;} } </script>​

SharePoint Form Digest

Form Digest Form Digest is used to insert a security validation for SharePoint pages. The digest value will be created by SharePoint server during page creation. Example:  A user loads a SharePoint page. He injected a script which updates the list data. When the user posts the page, the server will check Form Digest value against the page content. Thus, security attacks can be prevented. Viewing Form Digest You can use the view-source of a SharePoint page to see the form digest value. The value is stored under name  ___REQUESTDIGEST .