Click to return to the DHTML, HTML     
onerror Event     Behaviors Library    
Web Workshop  |  DHTML, HTML & CSS

mask Behavior


Grants a masked edit behavior to Dynamic HTML objects.

Syntax

XMLN/A
HTML<ELEMENT STYLE="behavior:url('mask.htc')" ID=sID>
ScriptoElement.style.behavior = "url('mask.htc')"
oElement.addBehavior ("mask.htc")

Members

Remarks

The behavior-defined members listed in the preceding table are not accessible through script until the window.onload event fires. Waiting for this event to fire ensures that the page is completely loaded, that all behaviors have been applied to corresponding elements on the page, and, consequently, that all the behavior's properties, methods, and events are available for scripting. Attempting to use any of the behavior-defined members will result in a scripting error indicating that the object does not support that particular member.

The mask edit behavior is applied to INPUT elements that allow data entry to provide a combination of restricted input as well as formatted output. When information is entered, visual cues are provided about the type of acceptable information, and feedback about incorrect entries. The behavior can be applied to many common types of forms fields, such as date, time, and phone number fields. These masks can be applied through one of several preset formats.

The mask.htc file can be downloaded from the mask sample page.

Example

This sample demonstrates the implementation and adjustments of the mask behavior.

<STYLE>
   .mask{behavior: url(/behaviors/mask.htc);}
</STYLE>

<INPUT TYPE = "text" CLASS = "mask">
This feature requires Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

See Also

DHTML Behaviors, Using DHTML Behaviors



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.