SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Sharepoint 2010 ModalDialog title


I am creating a popup window in sharepoint using this code in javascript.

function openAutoResizableDialog(title, url, CallResult) {
    var options = { url: getUrl(url),
        title: title,
        allowMaximize: true,
        showClose: true,
        autoSize: true,
        dialogReturnValueCallback: CallResult
    ModalDialog = SP.UI.ModalDialog.showModalDialog(options);
    return ModalDialog;

I want to know if anyone has an idea on how to change the title of the Modal Dialog dynamically when it is open.

For example when the popup opens the title is "my title" and when i press a button in the page that is contained in the popup the title changes.

Can it be done?

Thank you for your time.

share|improve this question

migrated from May 20 '11 at 13:50

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Andrey Markeev, Anders Rask May 20 '11 at 21:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 1 down vote accepted

This is what i ended up doing. It worked perfectly.

SP.UI.UIUtility.setInnerText(parent.document.getElementByI("dialogTitleSpan"), "hello");


parent.document.getElementById("dialogTitleSpan").innerHTML = "Hello";
share|improve this answer

Of course it can be done. It's just HTML isn't it?

When using jQuery

$("#dialogTitleSpan").text("Some other title.");

Javascript only solution

document.getElementById("dialogTitleSpan").innerHTML = "Some other title";
share|improve this answer