libs/web: treat .rmempty like .optional for live field validation

This commit is contained in:
Jo-Philipp Wich 2010-11-16 18:05:17 +00:00
parent 1c243cc3b1
commit b17848e82e
2 changed files with 2 additions and 2 deletions

View file

@ -39,7 +39,7 @@ cbi_dynlist_init('<%=cbid%>');
<%- end -%>', '<%: -- custom -- %>'); <%- end -%>', '<%: -- custom -- %>');
<% end -%> <% end -%>
<% for i=1, #vals + 1 do -%> <% 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 %>
<% end -%> <% end -%>
</script> </script>

View file

@ -40,7 +40,7 @@ $Id$
<%- end -%>'); <%- end -%>');
<%- end %> <%- end %>
<% if self.datatype then -%> <% 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 %>
</script> </script>
<% end -%> <% end -%>