How would I go about hiding the ribbon in a task form? I have the form default open in edit mode and don't want the user to be able to see the ribbon at all. Is this possible?


If your form is opening in a dialog, you can do it using jQuery:

 $('.ms-dialog #s4-ribbonrow').css('display', 'none');

or just by embedding some CSS on the page:

.ms-dialog #s4-ribborow {
    display: none;

Or as Danny Engelman pointed out in the comments, if you do not want to load jQuery you can do it with pure Javascript:

<script type="text/javascript">
  • Or just document.querySelector('#s4-ribbonrow').style.display='none'; if you do not know or want to load jQuery... Note that you can't use SharePoints own mQuery as it is not loaded by default on this form – Danny '365CSI' Engelman Jan 4 '16 at 20:35
  • Thanks guys..would I just insert that anywhere in the editform file? – RJaxx Jan 4 '16 at 20:38
  • Yes, you can insert it in the edit form file using Designer, or you could add a script editor web part to the page and add it that way. Keep in mind, if you are usig one of the Javascript methods, you'll need enclosing <script> tags, and if you are using the CSS way, you need enclosing <style> tags – Dylan Cristy Jan 4 '16 at 20:53
  • Thanks Dylan. I added the following to the end of my file, but was unable to get it to load correctly...am I missing something? <style> .ms-dialog #s4-ribbonrow{ display: none; } – RJaxx Jan 4 '16 at 21:08
  • I would add it high on the page, not at the end. And do you have a closing </style> tag? See my updated answer. – Dylan Cristy Jan 4 '16 at 21:13

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.