From 2beee5c645c3866b0cb70cf51a2c3b8fbba6bc6e Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sat, 28 Dec 2024 02:03:41 +0100 Subject: [PATCH] validate_form(): add support of Bootstrap switches --- static/js/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/js/app.js b/static/js/app.js index ad6adec..67f5486 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -148,6 +148,11 @@ function validate_form(form, keep_empty = false) { data[$(checkbox).attr("name")] = $(checkbox).is(":checked"); } }); + form.find(".form-switch input[type=checkbox]").each(function (idx, checkbox) { + if ($(checkbox).attr("name")) { + data[$(checkbox).attr("name")] = $(checkbox).is(":checked"); + } + }); console.log(data); return data; }