Enable/Disable button in luci lua

Is there any way in which we can use button of enable/disable in its real sense in LUCI LUA.
Like if I select enable button then I must be able to write some config parameters in UCI file and If I select disable then can remove those parameters from UCI config file.

Take the enable/ disable button for the wireless interfaces as example.

Hi @slh
its not there in that portion.
What i need to implement is when i select enable button lets say 2 parameters gets set uci config file.
But in wireless interface its like when we select enable the corresponding value gets written in uci config file. I don't need to write that value.

Than you should write your desired value. :thinking:

I think we aren't understanding what do you wan to do... Please beore precise, probably with a example of what value you want to set...

You can override the .write() function of each CBI option to do arbitrary things, e.g.:

o = s:option(Button, ...)
o.write = function(self, section_id, formvalue)
    self.map:set(section_id, "foo", "this")
    self.map:set(section_id, "bar", "that")