Vie (0) Tulosta
Laajenna kaikki
all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize
EN
Tätä sisältöä ei ole saatavilla kielelläsi. Tässä on englanninkielinen versio.

datafld attribute | dataFld property

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

Syntax

HTML<element datafld="p" ... >
JavaScript

p = object.dataFld

Property values

Type: String

the field name.

Remarks

The dataFld property is not available on param objects; use getAttribute('dataFld') instead.

Examples

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 in a table, it is repeated, and all values in the flavor column are displayed.


<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. 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>

See also

a
applet
button
div
fieldSet
frame
iframe
img
input type=button
input type=checkbox
input type=email
input type=hidden
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=search
input type=tel
input type=text
input type=url
label
legend
marquee
object
param
select
span
textArea
Introduction to Data Binding

 

 

Näytä:
© 2014 Microsoft