1

I want to hide ribbon form my newform.aspx & editform.aspx forms only. I don't want to hide ribbon from my whole site. I just want that whenever a user add or edit item top ribbon must be hidden from user

3

One possibility would be to add some javascript to your masterpage code's <head>. This code checks your current location and if the location has newform.aspx or editform.aspx in it, it'll hide the ribbon.

<script type="text/javascript "src="http://mypath.com/Scripts/jquery.min.js</script>
<script type="text/javascript">
$( document ).ready(function() {
var pathname = window.location.pathname;

if (pathname.indexOf("newform.aspx") >= 0)
document.getElementById( 'RibbonContainer' ).style.display = 'none';
else if (pathname.indexOf("editform.aspx") >= 0)
document.getElementById( 'RibbonContainer' ).style.display = 'none';
});
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.