From 3d8f5d14069b43b4f0c6cb84f2f384c87b8fad2c Mon Sep 17 00:00:00 2001 From: Derek Kaijser Date: Thu, 2 Mar 2017 11:58:39 +1300 Subject: [PATCH] Fix logic for radio buttons parents only works if you have a single radio group with conditionals. closest is what we want. --- code/model/UserDefinedForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php index 94ad55e..5937cc3 100755 --- a/code/model/UserDefinedForm.php +++ b/code/model/UserDefinedForm.php @@ -517,7 +517,7 @@ class UserDefinedForm_Controller extends Page_Controller $expression = '$(this).prop("checked")'; } elseif ($radioField) { // We cannot simply get the value of the radio group, we need to find the checked option first. - $expression = '$(this).parents(".field, .control-group").find("input:checked").val()=="'. $rule->FieldValue .'"'; + $expression = '$(this).closest(".field, .control-group").find("input:checked").val()=="'. $rule->FieldValue .'"'; } else { $expression = '$(this).val() == "'. $rule->FieldValue .'"'; }