getCurrentValue(): get the title

Whenever an update cycle occurs, as determined by the default update frequency of the onEdit event handler, Adobe Dreamweaver calls the getCurrentValue() function to determine what value to display for the control. The default update frequency of the onEdit handler determines the update frequency because the Title text edit control has no update attribute.

For the Title text box, the following getCurrentValue() function calls the JavaScript application programming interface (API) function dom.getTitle() to obtain and return the current title.

The function is as follows:

function getCurrentValue(){ var title = ""; var dom = dw.getDocumentDOM();  if (dom) title = dom.getTitle();  return title;}

Until the user enters a title for the document, the getTitle() function returns Untitled Document, which appears in the text box. After the user enters a title, the getTitle() function returns that value, and Adobe Dreamweaver displays it as the new document title.

To see the complete HTML file that contains the JavaScript functions for the Title text box, see the EditTitle.htm file in the Toolbars/MM folder.

The MM folder is reserved for Adobe files. Create another folder inside the Toolbars folder, and place your JavaScript code in that folder.