aspxtreme

DATAFLD Attribute | dataFld Property

HTML Elements/DHTML Objects   Element Attributes


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

Syntax


HTML <ELEMENT DATAFLD = sField ... >
Script object.dataFld [ = sField ]

Possible Values


sField String specifying the field name.

The property is read/write with no default value.

Remarks

The property can be set at design time and at run time. At design time, use the DATAFLD attribute.

Example

In the following 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.

<table DATAsrc="#ice_cream">
<tr>
  <td><input type=TEXT DATAFLD=flavor></td></tr>
</table>

In the following 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>


Books and more ...

Contents
HTML Elements / DOM Objects
HTML Element Attributes
CSS Attributes
DOM Object Properties
DOM-compliant Events Reference
DOM Methods Reference
DOM Collections Reference
 


Suggested Reading



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support aspxtreme