how can I change the title of a modal window open through the command using?

ExecuteOrDelayUntilScriptLoaded(function () { openModalWindow('.....')},\"sp.js\");  

I would like the person to see: loading ...

and at the end of the loading to then show the true title of the page.


This solution sets the title of the modal window, I would like to change the title after the window has been opened.

hi you can find the same question here:

Pass parameters in ExecuteOrDelayuntilScriptLoaded in Javascript client Object model

To make changes to the title like so in javascript:

var win = window.open();

win.document.title="......Change Me......";

I don't know how you plan on loading your modal dialog, but usually you can just do as below:

var options = SP.UI.$create_DialogOptions();
options.url = "url to the page";
options.title = "Modal Dialog Title Here";

SP.UI.ModalDialog.showModalDialog(options);

Which then would make yours look something like this:

var options = SP.UI.$create_DialogOptions();
options.url = "url to the page";
options.title = "Modal Dialog Title Here";

ExecuteOrDelayUntilScriptLoaded(function () { SP.UI.ModalDialog.showModalDialog(options);},"sp.js");  
  • I would like to change the title of modaldialog once the page in dialog is fully charged. – Simone Polinari Aug 21 '12 at 7:05

Simonw pass the title like so:

<a href="#" onclick="openDialog('Test.aspx?ID={@ID}','{$title}'); return true "/>

<script type="text/javascript">
function openDialog(FormPath,Title) {
    var options = {
        url: FormPath,
        width: 950,
        height: 800,
        title: Title,
        allowMaximize:'true'

    };
    SP.UI.ModalDialog.showModalDialog(options);
}
</script>

Hope this helps

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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