I’m using a form with a combobox.
The combobox has data with one of the values being 0.
When I do getValue() on the form the combobox doesn’t report the value.
Is there a workaround for this? we can’t change the 0 value as it relates to another item.
You can see this here: DHTMLX Snippet Tool
Hello @tonygoodchild ,
It’s an issue on our end and the dev team will try to fix it in future versions (even is it’s not suggested to use id: 0 in JavaScript).
As a workaround, you can get the exact value of combo control, with internal properties, like follows:
console.log( form.getItem('combo').combobox._state.value)
Or by manual converting the getValue result to number, like follows:
console.log(+form.getItem('combo').getValue())
Here is a demo:
https://snippet.dhtmlx.com/5jtxpore
Kind regards,
Siarhei
November 17, 2025, 6:46pm
#3
Hello @tonygoodchild ,
The dev team already fixed the issue for 0 ID’s in the latest update:
You can explore what's new in DHTMLX Suite and its release history in the documentation of the DHTMLX JavaScript UI library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation...
Here is a demo where you can test it:
https://snippet.dhtmlx.com/9ht55k4x
Kind regards,