DATAFORMATAS Attribute | dataFormatAs Property

Internet Development Index

Sets or retrieves how to render the data supplied to the object.

Syntax

HTML<ELEMENT DATAFORMATAS = sFormat... >
Scriptingobject.dataFormatAs [ = sFormat ]

Possible Values

sFormatString that specifies or receives one of the following values.
textDefault. Data is rendered as text.
htmlData is rendered as HTML.
localized-textMicrosoft® Internet Explorer 5.01 and later versions. Data is rendered using the locale settings of the client machine.

The property is read/write. The property has a default value of text.

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

Remarks

Internet Explorer 5.01 or later honors the user's control panel regional settings when the DATAFORMATAS attribute is set to localized-text. Internet Explorer 5.01 or later performs a locale-dependent type conversion on the native value, instead of asking the data source object to perform the conversion, when binding a textual element such as a span, div, or input to date, currency, or numeric data. Internet Explorer 5 does not provide this feature. To compensate for this limitation, a data source object can implement ISimpleDataConverter to participate in the conversion. Neither of these features is supported in earlier versions of Internet Explorer.

Examples

This div example renders data in HTML format.

<DIV DATAFLD="Column2" DATAFORMATAS="html"></DIV>

This span example renders data in HTML format.

<SPAN DATASRC="#bank_acct" DATAFLD="balance" DATAFORMATAS="html"></SPAN>

This textArea example renders data in text format.

<TEXTAREA DATASRC="#customer" DATAFLD="address" DATAFORMATAS="text" ROWS=6 COLS=60></TEXTAREA>

Standards Information

There is no public standard that applies to this property.

Applies To

BUTTON, DIV, INPUT type=button, LABEL, LEGEND, MARQUEE, SPAN

See Also

Introduction to Data Binding