Merge pull request #553 from TcFxGt4AGE/patch-1

Fix logic for radio buttons
This commit is contained in:
Daniel Hensby 2017-03-06 17:15:38 +00:00 committed by GitHub
commit 84eecb0b76

View File

@ -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 .'"';
}