ED Coder · Jan 6, 2021

How to Get value from zen component

I am new to zen pages, and trying to see how to get the value of a control.

Below is what I have

<combobox id="comboboxEdit" label="Select">
<option value="1" text="1" />
<option value="2" text="2" />

<button id="appointments" label=" " caption="Fetch" onclick="zenPage.Fetch();hidden="false"/>

ClientMethod Fetch() [ Language = javascript ]

// how can I get the value of the controls here? can I do something like document.getElementById()?


Product version: Ensemble 2017.1
0 161
Discussion (3)1
Log in or sign up to continue

You can get the value by : zenPage.getComponentById('dtfrom').value;

Note - it's generally better practice to use

or equivalently (and shorter),

super. thank you for the best practice guidance