LuCI: Better way to store hidden data

On the documentation page for LuCI.form.HiddenValue there is stated that it is for legacy purpose and

With client side handling of forms, there are more efficient ways to store hidden state data.

But which ways? Can you please point me to some technique how to store hidden data without creating hidden form fields?

E.g. I would like to always overwrite certain value in the configuration with constant. Or I would like to precalculate some value from other fields.

Hello. I'm looking for something like this, but as I'm not an expert, my question would be: How to simply add a fixed "tag" in the configuration file without showing it on the web interface. I want to add the version number of the configuration in my configuration file.
Something like: version=1.2, and add it in the config file.
Thanks

Just searching for hidden in the official docs brings these up: https://openwrt.github.io/luci/jsapi/LuCI.ui.Hiddenfield.html and https://openwrt.github.io/luci/jsapi/LuCI.form.HiddenValue.html and https://openwrt.github.io/luci/jsapi/LuCI.form.DummyValue.html with hidden property or you may want to define the on_save/on_commit functions instead.

Since you shared very little on what (and why) you're trying to do, hard to guess which one might work best.

1 Like