DATAFLD Attribute | dataFld Property

DHTML, HTML, & CSS

 
Click to return to the DHTML, HTML & CSS home page    
data Property     dataFld Property     DHTML Properties    

DATAFLD Attribute | dataFld Property


Sets or retrieves which field of a given data source, as specified by the dataSrc property, to bind to the specified object.

Syntax

HTML<ELEMENT DATAFLD = sField ... >
Scriptingobject.dataFld [ = sField ]

Possible Values

sFieldString that specifies the field name.

The property is read/write with no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Example

In this example, a text box is bound to the flavor field supplied by a data source object with an ID of ice_cream. Because the text box is contained within a table, the text box is repeated and all values in the flavor column are displayed.

Sample Code

<TABLE DATASRC="#ice_cream">
   <TR><TD><INPUT TYPE=TEXTBOX DATAFLD=flavor></TD></TR>
</TABLE>

In this example, the SELECT object is bound to the card_type column of a data source control with an ID of order. The value of the field in the data set determines the option that is initially selected. In addition, when the user selects a different option from the SELECT, the value of the card_type field in the current record of the data set is updated.

<SELECT DATASRC="#order" DATAFLD="card_type">
   <OPTION>Visa
   <OPTION>Mastercard
   <OPTION>American Express
   <OPTION>Diner's Club
   <OPTION>Discover
</SELECT>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A, APPLET, BODY, BUTTON, DIV, FRAME, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, LABEL, MARQUEE, OBJECT, PARAM, SELECT, SPAN, TEXTAREA

See Also

data bindingInternet Link


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.