0

I have created list items links. When user clicks on them, the DispForm.aspx gets opened as a modal popup. I want to hide the ribbon that comes on the top. I have used javascript code to open list items as a modal popup. Please suggest how to hide the list ribbon using javascript.

1 Answer 1

1

add this CSS to the page you want to open as modal

/* hide ribbon in modal dialog window */ .ms-dialog #s4-ribbonrow { display: none; }

5
  • Please help me with javascript code.
    – Ruchi
    Mar 19, 2015 at 7:53
  • @Ruchi you wont need javascript just add the above code to css in your page which you are opening as modal popup Mar 19, 2015 at 9:13
  • function popup_broadcast(ID) { var options = SP.UI.$create_DialogOptions(); options.width = 1200; options.height = 800; options.url = "/Lists/News%20%20Broadcasts/DispForm.aspx?ID=" + ID; options.dialogReturnValueCallback = Function.createDelegate(null, success); options.showClose = true; SP.UI.ModalDialog.showModalDialog(options); } This is my code that opens list item that are coming as hyperlink in a modal popup.Where should I put that css?
    – Ruchi
    Mar 19, 2015 at 10:52
  • open your page in SharePoint designer, edit it with advance mode, you will find "<SharePoint:StyleBlock runat="server"> </SharePoint:StyleBlock>" tag just paste it inside that tag Mar 19, 2015 at 11:13
  • WC.. you can just mark it as answer for future reference Mar 20, 2015 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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