Tag Info

Hot answers tagged


Lists columns have this functionality built in. Simply enable the enforce unique values option on your desired column. Then you try to add your item like normal in your JavaScript code. Any error you will receive in the callback and you can handle however you'd like at that point. Let the built in SharePoint functionality work for you.


webPermMasks are TWO 32-bit integers indicating which permissions a user has. Each bit represents a permission. (_spPageContextInfo.webPermMasks.High).toString(2) (_spPageContextInfo.webPermMasks.Low).toString(2) Displays the bits High & Low In the good old days computer worked with 8 bits, which someone name a Byte. With 8 bits (8 permissions) you ...


Here is some other code that gets you started: function remaining(Y, M, D, h, m, s) { var t = new Date(Y, M, D, h, m, s) - new Date(), timers = [t / (36e5 * 24), (t / 36e5) % 24, (t / 6e4) % 60, (t / 1e3) % 60]; return t > 0 ? timers.map(function (T) { return String.format('{0:D2}', ~~T); }).join(':') : false; } var countdown ...


Use oListItem.set_item("Manager", SP.FieldUserValue.fromUser(managerTitle)); to set the person type field.


I figured it out shortly after I posted. I changed <input type="submit" id="btnSubmit" value="Submit form" /> to <input type="button" id="btnSubmit" value="Submit form" /> From what I was able to find, type="submit" posts the form content, which looks like a page refresh.


Though you should write the JS code here but I can safely assume that your JS is accessing some list on which the user don't have permission. It's not about the permission on JS file it's al about the permission on the resources your JS file is trying to access.


if you only want to hide some ribbon buttons, you can use a Content Editor web part in the library page, add some css to hide those button. some thing like this: <style> #Ribbon\.ListItem\.New\.NewFolder-Large { display: none; } </style> A more decent way is to deploy a SharePoint feature (Element.xml) to hide certain buttons. ...

Only top voted, non community-wiki answers of a minimum length are eligible