Promise in luci validation

@jow sorry if i disturb you...
I'm adding some feature to the ddns luci app and I'm having some problem with trying to use promise in the validate function...

I can't really find any example on how to bind the validate function and wait for the data.
For no it does output [object Promise]

(The idea is that the user has a list of value and as soon as the user selects it, the app validates it and display appropriate section based on it.)

Is this logic wrong and the validate function must work only on local data or this should be fine?

The validate function must be ran synchronously, it cannot return a promise. It is also very frequently invoked (e.g. for each keystroke, focus/blur etc.) so it should be as lightweight as possible.

Thx for the quick answer. Will try to workaround this limitation by giving all the data.

Maybe this helps for your use-case:

The idea is use onchange and do the required task, right? Thx for the suggestion

Yep, that was the idea.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.