views:

47

answers:

2

hi all, i am using the following code to hide the Actions menu from Discussion Board list. The code is :

<script src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.js"&gt;&lt;/script&gt; 
<script type="text/javascript" language="javascript"> 
    $(document).ready(function(){ 
        $('.ms-menutoolbar td:lt(4)').hide(); 
    }); 
</script>

I found this from an article, but its not working. Can you please help me regarding hiding Actions menu from Discussion Board list.

Also tried this code with no luck:

<script>
function HideDiv(name) {
    var div = document.getElementsByTagName('div');
    for (var i = 0; i < div.length; i++) {
        var str = div[i].id;
        if (str.indexOf(name) >= 0) {
            var viewInExplorer = div[i];
            if (viewInExplorer != null) {
                if (viewInExplorer.parentNode != null)  
                    viewInExplorer.parentNode.removeChild(viewInExplorer);
            }
        }
    }
}
HideDiv("ListActionsMenu");
</script>
+2  A: 

You might want to think about using a Custom Action to hide the menu items:

See:

http://msdn.microsoft.com/en-us/library/ms414790.aspx

and

http://msdn.microsoft.com/en-us/library/ms465980.aspx

Peter Walke
+1  A: 

You can use the below script but i would suggest to use custom master page in which you just remove site action or apply a sharepoint security trim control so that it is visible to administrator only

<script type="text/javascript" > this.document.getElementById("siteactiontd").style.display = 'none'; </script>
Ashutosh Singh
thanks ashutosh. I have a doubt regarding sharepoint login. When i accessing a sharepoint site, it prompts for the user to enter username and password. If he clicks cancel button, the page is hsowing 401:unauthorized. I want to redirect the page to home(welcome)page when he clicks cancel button. how to achieve this?
Abhimanyu

related questions