Whatever message this page gives is out now! Go check it out!

ColdFusion.getElementValue

Last update:
May 18, 2026

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, 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, 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 controls:
  • cfgrid
  • cfinput controls with checkbox, datefield, file, hidden, radio, or text types
  • cfselect
  • cftextarea
  • cftree

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page