2 <input type="<%=self.password and 'password" class="cbi-input-password' or 'text" class="cbi-input-text' %>" onchange="cbi_d_update(this.id)"<%=
3 attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section) or self.default) ..
4 ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder")
6 <% if self.password then %><img src="<%=resource%>/cbi/reload.gif" style="vertical-align:middle" title="<%:Reveal/hide password%>" onclick="var e = document.getElementById('<%=cbid%>'); e.type = (e.type=='password') ? 'text' : 'password';" /><% end %>
7 <% if #self.keylist > 0 or self.datatype then -%>
8 <script type="text/javascript">
9 <% if #self.keylist > 0 then -%>
10 cbi_combobox_init('<%=cbid%>', {
12 for i, k in ipairs(self.keylist) do
14 <%-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%>
15 <%-if i<#self.keylist then-%>,<%-end-%>
19 }, '<%- if not self.rmempty and not self.optional then -%>
20 <%-: -- Please choose -- -%>
22 <%- if self.combobox_manual then -%>
23 <%-=self.combobox_manual-%>
28 <% if self.datatype then -%>
29 cbi_validate_field('<%=cbid%>', <%=tostring((self.optional or self.rmempty) == true)%>, '<%=self.datatype%>');