Skip to main content

getValue()

returns IDs of options which are currently selected in the Combo control

getValue(): Id | Id[];

Returns:

A string/number or an array with the ID(s) of the options from data collection that are currently selected in the control.

Example‚Äč

When the multiselection property of Combo control isn't specified or is set to false, the method returns a string/number value with the ID of the currently selected option:

const value = form.getItem("combo").getValue();
// -> "id_2"

If multiselection is enabled, the method returns an array of string/number values with the IDs of the currently selected options:

const value = form.getItem("combo").getValue();
// -> ['id_1', 'id_2']