95e477d23589ca949d2fe010020faf428b15040a
[project/luci.git] / libs / cbi / luasrc / 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                                                                 <input type="radio" id="cbid.<%=self.config.."."..section.."."..self.option%>" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:cfgvalue(section) == key then %> checked="checked"<% end %> value="<%=key%>" />
13                                                                 <label for="cbid.<%=self.config.."."..section.."."..self.option%>"><%=self.vallist[i]%></label><br />
14 <% if c == self.size then c = 0 %><br />
15 <% end end %>
16 <% end %>
17 <%+cbi/valuefooter%>