Specifications

Chapter 13142
Example
The following instance of inspectBehavior(), taken from Display Status Message.htm, fills in
the Message field in the parameters form with the message that the user selected when the
behavior was originally applied:
function inspectBehavior(msgStr){
var startStr = msgStr.indexOf("’") + 1;
var endStr = msgStr.lastIndexOf("’");
if (startStr > 0 && endStr > startStr) {
document.theForm.message.value = ¬
unescQuotes(msgStr.substring(startStr,endStr));
}
}
Note: For more information about the unescQuotes() function, see the dwscripts.js file in the Configuration/
Shared/Common/Scripts/CMN folder.
windowDimensions()
Description
Sets specific dimensions for the Parameters dialog box. If this function is not defined, the window
dimensions are computed automatically.
Note: Do not define this function unless you want an Parameters dialog box that is larger than 640 x 480 pixels.
Arguments
platform
The value of the argument is either "macintosh" or "windows", depending on the users platform.
Returns
Dreamweaver expects a string of the form "widthInPixels,heightInPixels".
The returned dimensions are smaller than the size of the entire dialog box because they do not
include the area for the OK and Cancel buttons. If the returned dimensions do not accommodate
all options, scroll bars appear.
Example
The following instance of windowDimensions() sets the dimensions of the Parameters dialog box
to 648 x 520 pixels:
function windowDimensions(){
return "648,520";
}
What to do when an action requires a return value
Sometimes an event handler must have a return value (for example,
onMouseOver="window.status=’This is a link’; return true"). But if Dreamweaver
inserts
"return behaviorName(args)" into the event handler, behaviors later in the list
are skipped.
To get around this limitation, set a variable called
document.MM_returnValue to the desired
return value within the string that
behaviorFunction() returns. This setting causes
Dreamweaver to insert
return document.MM_returnValue at the end of the list of actions in
the event handler. See the Validate Form.js file in the Configuration/Behaviors/Actions folder
within the Dreamweaver application folder for an example of the use of
MM_returnValue.