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");