2
0

ipaddr.htm 1.0 KB

123456789101112131415161718192021222324252627
  1. <%+cbi/valueheader%>
  2. <script>
  3. function switchToCIDRList(ev) {
  4. var input = ev.target.previousElementSibling,
  5. usecidr = document.getElementById(input.id + '_usecidr');
  6. ev.preventDefault();
  7. usecidr.value = '1';
  8. cbi_d_update();
  9. }
  10. </script>
  11. <input data-update="change"<%=
  12. attr("id", cbid) ..
  13. attr("name", cbid) ..
  14. attr("type", "text") ..
  15. attr("class", "cbi-input-text") ..
  16. attr("value", self:cfgvalue(section) or self.default) ..
  17. ifattr(self.size, "size") ..
  18. ifattr(self.placeholder, "placeholder") ..
  19. ifattr(self.datatype, "data-type", self.datatype) ..
  20. ifattr(self.datatype, "data-optional", self.optional or self.rmempty) ..
  21. ifattr(self.combobox_manual, "data-manual", self.combobox_manual) ..
  22. ifattr(#self.keylist > 0, "data-choices", { self.keylist, self.vallist })
  23. %> /><!--
  24. --><button class="btn cbi-button cbi-button-neutral" title="<%:Switch to CIDR list notation%>" aria-label="<%:Switch to CIDR list notation%>" onclick="switchToCIDRList(event)">…</button>
  25. <%+cbi/valuefooter%>