summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-09-07 23:03:05 +0000
committerSteven Barth <steven@midlink.org>2008-09-07 23:03:05 +0000
commit2590722de0a23456aa029c8db551964c7595eccd (patch)
tree71234bb772bd67e76e4b9b82c041e489a2ec61bd /libs/cbi
parent7fb577f21e7fab5e88e5dcccc90e6d585700b3eb (diff)
libs/cbi: Fixed DynamicLists
Diffstat (limited to 'libs/cbi')
-rw-r--r--libs/cbi/luasrc/cbi.lua2
-rw-r--r--libs/cbi/luasrc/view/cbi/dynlist.htm5
2 files changed, 4 insertions, 3 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index 3e7209781..30727cef2 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -1227,7 +1227,7 @@ function StaticList.validate(self, value)
local valid = {}
for i, v in ipairs(value) do
- if luci.util.contains(self.valuelist, v) then
+ if luci.util.contains(self.vallist, v) then
table.insert(valid, v)
end
end
diff --git a/libs/cbi/luasrc/view/cbi/dynlist.htm b/libs/cbi/luasrc/view/cbi/dynlist.htm
index 1368872d9..1d28f95d9 100644
--- a/libs/cbi/luasrc/view/cbi/dynlist.htm
+++ b/libs/cbi/luasrc/view/cbi/dynlist.htm
@@ -13,13 +13,14 @@ $Id$
-%>
<%+cbi/valueheader%>
+<%
local vals = self:cfgvalue(section)
for i=1, #vals + 1 do
local val = vals[i]
%>
- <input onchange="cbi_d_update(this.id)" type="text"<%= attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(val, "value") .. ifattr(self.size, "size")%> />
+ <input value="<%=val%>" onchange="cbi_d_update(this.id)" type="text"<%= attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(self.size, "size")%> />
<% if i <= #vals then %>
- <input type="image" value="<%:cbi_del%>" name="cbi.rle.<%=section .. "." .. self.option .. "." i%>" alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" />
+ <input type="image" value="<%:cbi_del%>" name="cbi.rle.<%=section .. "." .. self.option .. "." .. i%>" alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" />
<% else %>
<input type="image" value="<%:cbi_add%>" name="cbi.ale.<%=section .. "." .. self.option%>" alt="<%:cbi_add%>" title="<%:cbi_add%>" src="<%=resource%>/cbi/add.gif" />
<% end %>