Quick fixes: Removing the Delete button from a SharePoint 2007 OOTB edit form
I know what you're thinking. "If you don't want them to delete the item, why don't you just create a special permission level without the ability to do that?"
As it turns out, the poser of this particular puzzlement *did* in fact want the user to have delete permissions... but only via workflow. Yes, you can write a custom workflow that impersonates, blah blah blah, but this happened to be the quick and dirty solution for his immediate needs.
- Go to the Edit form.
- Pull down Site Actions -> Edit Page.
- Add a Content Editor Web Part (my favorite WP ever).
- Pull down Edit -> Modify Shared Web Part.
- Click the Source View button.
- Add the following JavaScript:
for(i=0;i<aList.length;i++) {
if(aList[i].innerHTML=="Delete Item") {
aList[i].parentElement.parentElement.style.display="none";
}
}
if(aList[i].innerHTML=="Delete Item") {
aList[i].parentElement.
}
}
Note: If you are using WSS instead of MOSS, you can tweak this to check for the title attribute instead of innerHTML, i.e.
if(aList[i].title=="Delete Item")
7.Save, OK, etc.