From b17848e82e0a7fa482900559aaf5c3a11d3f07d9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 16 Nov 2010 18:05:17 +0000 Subject: libs/web: treat .rmempty like .optional for live field validation --- libs/web/luasrc/view/cbi/dynlist.htm | 2 +- libs/web/luasrc/view/cbi/value.htm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/web/luasrc/view') 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 -%> 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 %> <% end -%> -- cgit v1.2.3