How can i write condition for executing shell command in lua when an option selected from dropdown

140 views Asked by At

I am new to openWrt. I have a selectbox with two options. How can I write condition in Lua to execute some commands when selecting these options.

<select id="AP_mode" name="AP_mode" class="AP_mode">
    <option value="" disabled selected>Ap Mode</option>
    <option value="0">Access Point1</option>
    <option value="1">Access Point2</option>
</select>
1

There are 1 answers

0
Shihab Pullissery On

You can use depends() function. Suppose you want to display some text box or value if the option is 0. then you can give.

p:depends("AP_node","0")
p:value(variable,translate(value))