-
----
Sets or retrieves whether a control or style is disabled.
Syntax
HTML <ELEMENT DISABLED ... >
Scripting object.disabled [ = bDisabled ]
Possible Values
false Control is not disabled.
true Control is disabled.
The property is read/write with a default value of false.
Expressions can be used in place of the preceding value(s), as of Microsoft?
Internet Explorer 5. For more information, see Dynamic Properties.
Remarks
When a control is disabled it appears dimmed and does not respond to user
input. When a style is disabled, all of the rules will cease to be rendered.
Keep in mind that the disabled property applies to the STYLE object, not the
style property.
Example
The following sample demonstrates how the disabled property can be used to
enable or disable a STYLE object and a control.
Hide Sample Code
<STYLE ID=oStyle>
.styletest{background-color: black; color: white;}
.styletest2{background-color: black; color: red;}
</STYLE>
<SCRIPT>
function fnSwitch(){
if(oParagraph.enablement == "enabled"){
// Use an arbitrary attribute to track the status
oParagraph.enablement = "disabled";
oButton.value = "Set disabled to false";
oStyle.disabled = true;
oDisableMe.disabled = true;
}
else{
oButton.value = "Set disabled to true";
oParagraph.enablement = "enabled";
oStyle.disabled = false;
oDisableMe.disabled = false;
Quote:
}
}
</SCRIPT>
:
<P enablement = "enabled" ID = oParagraph CLASS = "styletest">
A paragraph of text.
<INPUT TYPE = button ID = oDisableMe
CLASS = "styletest"
VALUE = "Demonstration Button"
onclick = "alert('Demonstration button')">
</P>
<INPUT TYPE=button
ID=oButton
VALUE="Set disabled to true"
onclick="fnSwitch()">
</snip>
Nic Roche
Net Extra
www.extra.net.au
Quote:
> Hello Everyone,
> I hope you can help me. I have created a form within an ASP. At the top
of
> this form are five buttons (such as New, Edit, Delete, Save, Cancel). I
> would like for some of these buttons to become disabled when others among
> them are chosen. For example, when a user clicks on the Edit button, the
> New button should become disabled. I am very unclear as to how to
> accomplish this within VBscript and would appreciate any guidance.
> Also, I am very new to the VBScript syntax. How did you learn it? How do
> you suggest I approach learning it?
> Thanks for any help you can give me!
> Kathleen