I have made a custom sharepoint site, where i have disabled the remove button from the ribbon and the context menu. But i just found out that then if I select an item in a document library, i can still press the delete key on the keybord and it will delete the item from the document library i will like to disable the delete key on the keyboard on the sharepoint site; how can this be done ?
add this in the cewp:
taken from here:
i just added the right keycode in for you :) , you would obviusly need to put the cewp on the document library page ;)
Ok just relised the code above wont work as it would be listing for an input so Iv dont the code for you! Its simple really and doesnt require you to assign the function to a input box or such, it check to see if your in a textbox and if you are then delete button works as normal otherwise its disabled :)
If you dont want that feature and want to disable it all together than add the following:
hope it helps!
Now, I find out the way to disable event delete on list view simply by edit code in core.js (..Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS).
Find the keyword "case Sys.UI.Key.del:" and comment HandleItemDelete like this.
save and try.
Another ways, you just modify current view, scroll to Tabular View => uncheck Allow individual item checkboxes => Save. This can prevent user delete row by delete key, but user cannot select multirow in table.