-<% self:render_children(section, scope or {}) %>
-
-<% if self.tag_deperror[section] then -%>
- <div class="cbi-error"><%:cbi_deperror%></div>
-<% elseif self.tag_invalid[section] then -%>
- <div class="cbi-error"><%:cbi_invalid_section%></div>
-<%- elseif self.tag_error[section] then -%>
- <div class="cbi-error"><%=self.tag_error[section]%></div>
+<%-
+ if type(self.hidden) == "table" then
+ for k, v in pairs(self.hidden) do
+-%>
+ <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
+<%-
+ end
+ end
+%>
+
+<% if self.tabs then %>
+ <%+cbi/tabcontainer%>
+<% else %>
+ <% self:render_children(section, scope or {}) %>
+<% end %>
+
+<% if self.error and self.error[section] then -%>
+ <div class="cbi-section-error">
+ <ul><% for _, e in ipairs(self.error[section]) do -%>
+ <li>
+ <%- if e == "invalid" then -%>
+ <%:One or more fields contain invalid values!%>
+ <%- elseif e == "missing" then -%>
+ <%:One or more required fields have no value!%>
+ <%- else -%>
+ <%=pcdata(e)%>
+ <%- end -%>
+ </li>
+ <%- end %></ul>
+ </div>