libs/web: treat .rmempty like .optional for live field validation
This commit is contained in:
parent
1c243cc3b1
commit
b17848e82e
2 changed files with 2 additions and 2 deletions
|
@ -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>
|
||||
|
|
|
@ -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 -%>
|
||||
|
|
Loading…
Reference in a new issue