Description
Returns a value that specifies whether the item is selected. For a button, checked means that
the button appears on or depressed. The
attribute in a toolbar item tag.
checked
Arguments
For pop-up menus, combo boxes, text boxes, and color pickers, the first argument is the
current value within the control. The
individual IDs to items within a pop-up menu. If the selected item in the menu has an ID
attached, Dreamweaver passes that ID to the
value. For combo boxes, if the current contents of the text box do not match an entry in the
pop-up menu, Dreamweaver passes the contents of the text box. For determining whether the
text box matches, Dreamweaver compares against the menu without case-sensitivity.
If you specified the
arguments
specify the
arguments
Returns
Dreamweaver expects a Boolean value:
Example
The following example determines which item, if any, should be checked in a pop-up menu of
paragraph formats and CSS styles:
function isCommandChecked()
{
var bChecked = false;
var style = arguments[0];
var textFormat = dw.getDocumentDOM().getTextFormat();
if (dw.getDocumentDOM() == null)
bChecked = false;
if (style == "(None)")
bChecked = (dw.cssStylePalette.getSelectedStyle() == '' || textFormat ==
"" || textFormat == "P" || textFormat == "PRE");
else if (style == "Heading 1")
bChecked =
(textFormat == "h1");
else if (style == "Heading 2")
bChecked =
(textFormat == "h2");
else if (style == "Heading 3")
bChecked =
(textFormat == "h3");
else if (style == "Heading 4")
bChecked =
(textFormat == "h4");
else if (style == "Heading 5")
bChecked =
(textFormat == "h5");
244
Toolbars
isCommandChecked()
getDynamicContent()
attribute, those arguments are passed next. If you do not
attribute, Dreamweaver passes the ID of the item.
true
function is equivalent to the
function can optionally attach
isCommandChecked()
if the item is checked;
function instead of the
otherwise.
false
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?