1

I have a requirement where i dont want to display "Title" in the Modal Dialog. If i pass an empty string to the title, the modal dialog displays the title as "Dialog" .I dont want anything to display as the Title.

Any idea on how it can be acieved?

6

enter image description here

Put empty white space in title. Example:

var options =
    {
    title: ' ',        
        url: '/_layouts/15/NY.ExportVersionHistory/ExportVersionHistory.aspx',
        height: 400,
        width: 300
    }

    SP.UI.ModalDialog.showModalDialog(options);

UPDATE

Having empty space in title should not result in any title being displayed in popup. Check the screenshot.

  • An empty space displays the title as "Dialog" in the modal dialog.Gave a try on it..dint work – user1111 Nov 25 '14 at 11:28
  • That's weird. it should work. Worked for me in the past – Denis Molodtsov Nov 25 '14 at 11:38
  • You can mark it as an answer if you feel if it helped resolve your issue. – Nadeem Yousuf-AIS Nov 25 '14 at 11:56
1

One way to achieve this is by hiding the Title bar using CSS

<style type="text/css">
body div.ms-dlgBorder div.ms-dlgTitle
{
    display:none;
}   
</style>
  • This will hide the title for any of the modal popup which come up in a page, rather i would want to hide it only to a specific popup. – user1111 Nov 25 '14 at 11:07
  • 1
    You can dynamically add/remove this Style based on the popup. For ex: if the dialog is opened on button click, handle that click event and add the style. Then remove it on the dialog exit handler. – Amal Hashim Nov 25 '14 at 11:09
  • May i know whether the code has to be written in the page coming up in the modal dialog or in the page where the modal dialog is present? – user1111 Nov 25 '14 at 11:31
  • Page where you are invoking the dialog. – Amal Hashim Nov 25 '14 at 11:35

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.