Merge pull request #1577 from linuxserver/fix/checkbox-test-config

Fix checkbox config values always returning "1" in Test config
This commit is contained in:
KodeStar
2026-07-09 22:06:42 +01:00
committed by GitHub
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -4271,7 +4271,12 @@ $.when($.ready).then(function () {
data.url = apiurl;
$(".config-item").each(function () {
var config = $(this).data("config");
data[config] = $(this).val();
// For checkboxes, use checked state instead of value attribute
if ($(this).is(":checkbox")) {
data[config] = $(this).is(":checked") ? "1" : "0";
} else {
data[config] = $(this).val();
}
});
data.id = $("form[data-item-id]").data("item-id");
if (data.password && data.password === fakePassword) {
+6 -1
View File
@@ -310,7 +310,12 @@ $.when($.ready).then(() => {
data.url = apiurl;
$(".config-item").each(function () {
const config = $(this).data("config");
data[config] = $(this).val();
// For checkboxes, use checked state instead of value attribute
if ($(this).is(":checkbox")) {
data[config] = $(this).is(":checked") ? "1" : "0";
} else {
data[config] = $(this).val();
}
});
data.id = $("form[data-item-id]").data("item-id");