From b400e14d10f01ac02c5c16951bbb76b1682c2e36 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 12 Oct 2020 19:54:04 +0200 Subject: [PATCH] wip #3924 @1.5 --- src/resources/views/when.blade.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/resources/views/when.blade.php b/src/resources/views/when.blade.php index 9941b78..04d4fcf 100644 --- a/src/resources/views/when.blade.php +++ b/src/resources/views/when.blade.php @@ -27,11 +27,23 @@ $(this).data('when-normalized', normalizeWhen($(this).data('when'))); } var when = $(this).data('when-normalized'); + var match = true; var order = 1000; $.each(when, function (property, conditions) { var fname = prefix + property; - var val = $(form).find('[name="' + fname + '"]').val().toString(); + var e = $(form).find('[name="' + fname + '"]'); + var val; + if ($(e).length === 1) { + val = $(e).val().toString(); + } else { + var f = $(e).filter(':checked,:not(:checkbox)').last(); + if ($(f).length === 0) { + val = ''; + } else { + val = $(f).val().toString(); + } + } var matchproperty = false; $.each(conditions, function (k, condition) { if (condition.id === val) { -- 2.39.5