diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-11-16 18:05:17 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-11-16 18:05:17 +0000 |
commit | b17848e82e0a7fa482900559aaf5c3a11d3f07d9 (patch) | |
tree | 66e161a26adcf5eb52ed930eacc84b9901333656 /libs/web | |
parent | 1c243cc3b16fc33334ad958fb3e798237ff133b8 (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.htm | 2 | ||||
-rw-r--r-- | libs/web/luasrc/view/cbi/value.htm | 2 |
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 387299dec..5f57941b8 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 84daafd46..d94863e90 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 -%> |