Written by

Question Nezla · Jun 23, 2021

findElement("input").value is not working

Hi Guys,

I've a combo inside a tabGroup inside a form and using :

var MyInput = zen("MyCombo").findElement("input").value;

is not finding the current input, any help pls?

Thanks

Product version: Ensemble 2016.1

Comments

David Hockenbroch · Jun 23, 2021

Can you post the code for your form? That would be very helpful.

0
Timothy Leavitt · Jun 23, 2021

I'd expect that to work provided the id (not name) of the combobox/dataCombo is 'MyCombo'. e.g., this works fine:

Class DC.Demo.FindElement Extends %ZEN.Component.page
{

XData Contents [ XMLNamespace = "http://www.intersystems.com/zen" ]
{
<page xmlns="http://www.intersystems.com/zen">
<form>
<tabGroup showTabBar="true">
<tab caption="Tab One">
<combobox id="MyCombo" editable="true" />
</tab>
<tab caption="Tab Two">
</tab>
</tabGroup>
</form>
<button onclick="zenPage.alertComboValue()" />
</page>
}

ClientMethod alertComboValue() [ Language = javascript ]
{
    alert(zen('MyCombo').findElement('input').value);
}

}
0
Nezla  Jun 23, 2021 to Timothy Leavitt

Thanks Timothy

0