f1ae5a093900db90c816d219646ad805d5d413c0
[project/luci.git] / core / src / ffluci / view / cbi / lvalue.htm
1 <%+cbi/valueheader%>
2 <% if self.widget == "select" then %>
3                                                                 <select onchange="cbi_d_update(this.id)" id="cbid.<%=self.config.."."..section.."."..self.option%>" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self.size then %> size="<%=self.size%>"<% end %>>
4 <%for i, key in pairs(self.keylist) do%>
5                                                                         <option<% if self:cfgvalue(section) == key then %> selected="selected"<% end %> value="<%=key%>"><%=self.vallist[i]%></option>
6 <% end %>
7                                                                 </select>
8 <% elseif self.widget == "radio" then
9         local c = 0;
10         for i, key in pairs(self.keylist) do
11         c = c + 1%>
12                                                                 <%=self.vallist[i]%><input type="radio" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:cfgvalue(section) == key then %> checked="checked"<% end %> value="<%=key%>" />
13 <% if c == self.size then c = 0 %><br />
14 <% end end %>
15 <% end %>
16 <%+cbi/valuefooter%>