From: Vincent Vanwaelscappel Date: Mon, 12 Oct 2020 17:54:04 +0000 (+0200) Subject: wip #3924 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b400e14d10f01ac02c5c16951bbb76b1682c2e36;p=cubist_cms-back.git wip #3924 @1.5 --- 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) {