Adds databinding capabilities to the SELECT element.
Syntax
XML N/A HTML <SELECT STYLE="behavior:url('dataselect.htc')" > Scripting object.style.behavior = "url('dataselect.htc')" object.addBehavior ("dataselect.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.
A data source object must be instantiated for the dataselect behavior to work. To learn more about data source objects, read the Data Binding overview. The sample included on this page provides the necessary code to instantiate a data source object.
Example
This sample demonstrates the implementation of the dataselect behavior to bind a text file to a SELECT element.
Sample Code
<HEAD> <STYLE> .bound{behavior: url("DataSelect.htc")} H1{font: bold 18pt verdana; color: navy;} P{font: 10pt verdana;} </STYLE> </HEAD> <BODY> <SELECT NAME="oTest" CLASS="bound" DATASRC="#oData" VALUE="4a" DATAFLDTEXT="column2" DATAFLDVALUE="column1" </SELECT> <!-- 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=","> </OBJECT> </BODY>
Applies To
SELECT
See Also