From 30cfcc7816ccc72152b33e1fe85808c2be20efba Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Fri, 6 Jan 2023 18:04:37 +0100 Subject: [PATCH] bugfix --- src/zutil/ui/conf/configurator.dynamic.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/zutil/ui/conf/configurator.dynamic.tmpl b/src/zutil/ui/conf/configurator.dynamic.tmpl index 089bf09..48bb3f5 100644 --- a/src/zutil/ui/conf/configurator.dynamic.tmpl +++ b/src/zutil/ui/conf/configurator.dynamic.tmpl @@ -28,22 +28,22 @@ if (formTemplateId != null) modal.find("#" + formTemplateId).empty(); // clear form div - // set dynamic form data + // Set dynamic form data $.each(button.attr(), function(fieldName, value) { if(fieldName.startsWith("data-")) { fieldName = fieldName.substring(5); // remove prefix data- - // case insensitive search + // Case-insensitive search var input = modal.find("input, select").filter(function() { if (this.name.toLowerCase() == fieldName) { - if (this.type == "hidden" && modal.find("input[type=checkbox][name=" + fieldName + "]") != null) + if (this.type == "hidden" && modal.find("input[type=checkbox][name=" + fieldName + "]").length > 0) return false; // Workaround for the default(false) boolean input return true; } return false; }); - if (input != null) { + if (input.length > 0) { if (input.prop("type") == "checkbox") { // special handling for checkboxes input.prop("value", "true"); input.prop("checked", value == "true");