* 3rd Package reorgnaisation
[project/luci.git] / libs / cbi / src / 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%>