Form keydown event

When you enter a value in the input box and press the Enter key, if you read the value of the input box using getValue(), it will appear blank(‘’). After the focus moves and moves back to the input box, the correct value is output only when the enter key is entered.
Isn’t there a way to read the value right away when you press the Enter key after entering it first?

Have you tried the ‘change’ event or the ’ beforeChange’ event (v8)?

It was solved using blur(), focus(), and wait() functions. Isn’t there an easier way?

1 Like

Please try to use:

form.events.on("keydown", function (event, name, id) {
    if (event.code == "Enter") {
        form.blur(id)
        dhx.awaitRedraw().then(function () {
            console.log(form.getValue())
        })
    }
})

Here is the example:
https://snippet.dhtmlx.com/r5mnc732