bugfix
This commit is contained in:
parent
bbd03b14be
commit
30cfcc7816
1 changed files with 4 additions and 4 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue