dataselect Behavior

This topic documents a feature of Binary Behaviors, which are obsolete as of Internet Explorer 10.

Adds databinding capabilities to the select element.


HTML <SELECT STYLE="behavior:url('')">
Scripting object .style.behavior = "url('')"
object .addBehavior ("")

Members Table

The following table lists the members exposed by the dataselect object.

Attribute Property Description
DATAFLDTEXT dataFldText Sets or retrieves the name of the field used for the visible text of the dataselect behavior options.
DATAFLDVALUE dataFldValue Sets or retrieves the name of the field used for the value of the dataselect behavior options.
DATASRC dataSrc Sets or retrieves the source of the data for the dataselect behavior.
VALUE value Sets or retrieves the initial selected option in the dataselect behavior.
Event Property Description
ondatasetcomplete Fires when the dataselect behavior populates the contents of a select element.


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.

A data source object must be instantiated for the dataselect behavior to work. To learn more about data source objects, read the Introduction to Data Binding overview. The sample included on this page provides the necessary code to instantiate a data source object.

The file can be downloaded from the dataselect  sample page.


This sample demonstrates the implementation of the dataselect behavior to bind a text file to a select element.

.bound{behavior: url("")}
H1{font: bold 18pt verdana; color: navy;}
P{font: 10pt verdana;}
<!-- Data source object must be present -->
<OBJECT ID="oData" CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
   <PARAM NAME="DataURL" VALUE="dataselect.txt">
   <PARAM NAME="FieldDelim" VALUE=",">

Code example:

Applies To


See Also

Community Additions