summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-11-16 18:05:17 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-11-16 18:05:17 +0000
commitb17848e82e0a7fa482900559aaf5c3a11d3f07d9 (patch)
tree66e161a26adcf5eb52ed930eacc84b9901333656 /libs/web
parent1c243cc3b16fc33334ad958fb3e798237ff133b8 (diff)
libs/web: treat .rmempty like .optional for live field validation
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/view/cbi/dynlist.htm2
-rw-r--r--libs/web/luasrc/view/cbi/value.htm2
2 files changed, 2 insertions, 2 deletions
diff --git a/libs/web/luasrc/view/cbi/dynlist.htm b/libs/web/luasrc/view/cbi/dynlist.htm
index 387299dec1..5f57941b80 100644
--- a/libs/web/luasrc/view/cbi/dynlist.htm
+++ b/libs/web/luasrc/view/cbi/dynlist.htm
@@ -39,7 +39,7 @@ cbi_dynlist_init('<%=cbid%>');
<%- end -%>', '<%: -- custom -- %>');
<% end -%>
<% for i=1, #vals + 1 do -%>
- cbi_validate_field('<%=cbid%>.<%=i%>', <%=tostring(self.optional == true or i > #vals)%>, '<%=self.datatype%>');
+ cbi_validate_field('<%=cbid%>.<%=i%>', <%=tostring((self.optional or self.rmempty) == true or i > #vals)%>, '<%=self.datatype%>');
<%- end %>
<% end -%>
</script>
diff --git a/libs/web/luasrc/view/cbi/value.htm b/libs/web/luasrc/view/cbi/value.htm
index 84daafd465..d94863e900 100644
--- a/libs/web/luasrc/view/cbi/value.htm
+++ b/libs/web/luasrc/view/cbi/value.htm
@@ -40,7 +40,7 @@ $Id$
<%- end -%>');
<%- end %>
<% if self.datatype then -%>
- cbi_validate_field('<%=cbid%>', <%=tostring(self.optional == true)%>, '<%=self.datatype%>');
+ cbi_validate_field('<%=cbid%>', <%=tostring((self.optional or self.rmempty) == true)%>, '<%=self.datatype%>');
<%- end %>
</script>
<% end -%>