libs/cbi: Fixed rendering of checkbox and radiobox-based widgets
authorSteven Barth <steven@midlink.org>
Sun, 6 Jul 2008 11:24:26 +0000 (11:24 +0000)
committerSteven Barth <steven@midlink.org>
Sun, 6 Jul 2008 11:24:26 +0000 (11:24 +0000)
libs/cbi/luasrc/view/cbi/lvalue.htm
libs/cbi/luasrc/view/cbi/mvalue.htm

index f1ae5a093900db90c816d219646ad805d5d413c0..95e477d23589ca949d2fe010020faf428b15040a 100644 (file)
@@ -9,7 +9,8 @@
        local c = 0;
        for i, key in pairs(self.keylist) do
        c = c + 1%>
-                                                               <%=self.vallist[i]%><input type="radio" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:cfgvalue(section) == key then %> checked="checked"<% end %> value="<%=key%>" />
+                                                               <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%>" />
+                                                               <label for="cbid.<%=self.config.."."..section.."."..self.option%>"><%=self.vallist[i]%></label><br />
 <% if c == self.size then c = 0 %><br />
 <% end end %>
 <% end %>
index bed66e569ab435d16cc2eca62059d19218c3d211..dcbf782ca1b46bc46f648c864d7caed2294d395f 100644 (file)
@@ -12,7 +12,8 @@ local v = self:valuelist(section)
        local c = 0;
        for i, key in pairs(self.keylist) do
        c = c + 1%>
-                                                               <%=self.vallist[i]%><input type="checkbox" name="cbid.<%=self.config.."."..section.."."..self.option%>[]"<% if luci.util.contains(v, key) then %> checked="checked"<% end %> value="<%=key%>" />
+                                                               <input type="checkbox" id="cbid.<%=self.config.."."..section.."."..self.option%>" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if luci.util.contains(v, key) then %> checked="checked"<% end %> value="<%=key%>" />
+                                                               <label for="cbid.<%=self.config.."."..section.."."..self.option%>"><%=self.vallist[i]%></label><br />
 <% if c == self.size then c = 0 %><br />
 <% end end %>
 <% end %>