2008-04-11 18:29:19 +00:00
< %+cbi/valueheader%>
2010-10-30 02:51:15 +00:00
< input type = "<%=self.password and 'password" class = "cbi-input-password' or 'text" class = "cbi-input-text' %>" onchange = "cbi_d_update(this.id)" < % =
attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section) or self.default) ..
ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder")
%> />
2009-11-10 01:42:18 +00:00
< % 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 %>
2010-04-26 21:42:10 +00:00
< % if #self.keylist > 0 or self.datatype then -%>
2012-04-15 14:31:04 +00:00
< script type = "text/javascript" > / / < ! [ C D A T A [
2010-04-26 21:42:10 +00:00
< % if #self.keylist > 0 then -%>
2008-08-04 17:16:27 +00:00
cbi_combobox_init('< %=cbid%>', {
< %-
for i, k in ipairs(self.keylist) do
-%>
2008-09-16 10:08:20 +00:00
< %-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%>
< %-if i< #self.keylist then-%>,< %-end-%>
2008-08-04 17:16:27 +00:00
< %-
end
-%>
2008-08-06 10:41:47 +00:00
}, '< %- if not self.rmempty and not self.optional then -%>
2009-11-22 20:33:16 +00:00
< %-: -- Please choose -- -%>
2012-08-09 11:25:25 +00:00
< %- elseif self.placeholder then -%>
< %-= pcdata(self.placeholder) -%>
2008-08-19 17:02:40 +00:00
< %- end -%>', '
< %- if self.combobox_manual then -%>
< %-=self.combobox_manual-%>
< %- else -%>
2009-10-31 20:03:27 +00:00
< %-: -- custom -- -%>
2008-08-19 17:02:40 +00:00
< %- end -%>');
2010-04-26 21:42:10 +00:00
< %- end %>
< % if self.datatype then -%>
2012-04-15 14:31:04 +00:00
cbi_validate_field('< %=cbid%>', < %=tostring((self.optional or self.rmempty) == true)%>, '< %=self.datatype:gsub("'", "\\'")%>');
2010-04-26 21:42:10 +00:00
< %- end %>
2012-04-15 14:31:04 +00:00
//]]>< / script >
2008-08-04 17:16:27 +00:00
< % end -%>
2008-04-11 18:29:19 +00:00
< %+cbi/valuefooter%>