|
@@ -55,7 +55,8 @@ function initform(form,map,ro = false) {
|
|
|
form = getelem(form);
|
|
|
|
|
|
for (var e of form.elements) {
|
|
|
- if (e.classList.contains('noinit'))
|
|
|
+ if (e.classList.contains('noinit') ||
|
|
|
+ e instanceof HTMLFieldSetElement)
|
|
|
continue;
|
|
|
if (ro && e.disabled != undefined)
|
|
|
e.disabled = true;
|
|
@@ -64,8 +65,6 @@ function initform(form,map,ro = false) {
|
|
|
const val = map.get(e.name);
|
|
|
if (val == null)
|
|
|
continue;
|
|
|
- if (ro && e.disabled != undefined)
|
|
|
- e.disabled = true;
|
|
|
if (e.type == 'checkbox') {
|
|
|
e.checked = cfgbool(val) == cfgbool(e.value);
|
|
|
} else if (e.type == 'radio') {
|
|
@@ -82,14 +81,13 @@ function initform(form,map,ro = false) {
|
|
|
// Load form initialization data
|
|
|
function loadform(form,url,ro = false) {
|
|
|
fetchconfig(url)
|
|
|
- .then((map) => initform(form,map,ro))
|
|
|
+ .then((map) => {initform(form,map,ro); })
|
|
|
.catch(() => {});
|
|
|
}
|
|
|
|
|
|
// Replace the contents of selected HTML elements based on a map with
|
|
|
// selectors.
|
|
|
-function fillin(map,html = false,top = document)
|
|
|
-{
|
|
|
+function fillin(map,html = false,top = document) {
|
|
|
for (const [key,val] of map) {
|
|
|
try {
|
|
|
const m = key.match(/(.*?)(?:\;([\w.-]*)(\??))?$/);
|