Adobe ColdFusion 8

ColdFusion.getElementValue

Description

Gets the value of an attribute of a bindable ColdFusion control.

Function syntax

ColdFusion.getElementValue(elementId [, formId, attributeName])

History

ColdFusion 8: Added this function

Parameters

Parameter

Description

elementId

The ID or name attribute of the control.

formId

The ID attribute of the form that contains the control. Omit this attribute if the element ID is unique on the page. If you omit this attribute and the element ID is not unique, the function uses the first element on the page with the specified ID.

attributeName

The control attribute to get; by default, the value attribute, or, for cfselect, the value of the selected element in the control.

For cfgrid controls, you must use this attribute and specify the name of the column whose value you are getting; the function returns the entry in the currently selected row.

For cftree controls, you must use this attribute and specify PATH or NODE. The function returns the item path or node value of the currently selected tree item.

Returns

The value of the specified attribute.

Usage

You can bind to, and get the attribute values of, the following HTML-format controls:

  • cfgrid
  • cfinput controls with checkbox, datefield, file, hidden, radio, or text types
  • cfselect
  • cftextarea
  • cftree