From c33b8ddec1ff26c417676658dc84ec743a89497e Mon Sep 17 00:00:00 2001 From: David Craig Date: Wed, 3 Dec 2014 13:59:42 +1300 Subject: [PATCH] Use $.prop() to query checkboxes --- code/model/UserDefinedForm.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php index 33d282a..18a950c 100755 --- a/code/model/UserDefinedForm.php +++ b/code/model/UserDefinedForm.php @@ -717,16 +717,16 @@ class UserDefinedForm_Controller extends Page_Controller { // and what should we evaluate switch($dependency['ConditionOption']) { case 'IsNotBlank': - $expression = ($checkboxField || $radioField) ? '$(this).attr("checked")' :'$(this).val() != ""'; + $expression = ($checkboxField || $radioField) ? '$(this).prop("checked")' :'$(this).val() != ""'; break; case 'IsBlank': - $expression = ($checkboxField || $radioField) ? '!($(this).attr("checked"))' : '$(this).val() == ""'; + $expression = ($checkboxField || $radioField) ? '!($(this).prop("checked"))' : '$(this).val() == ""'; break; case 'HasValue': if ($checkboxField) { - $expression = '$(this).attr("checked")'; + $expression = '$(this).prop("checked")'; } else if ($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()=="'. $dependency['Value'] .'"'; @@ -753,7 +753,7 @@ class UserDefinedForm_Controller extends Page_Controller { break; default: // ==HasNotValue if ($checkboxField) { - $expression = '!$(this).attr("checked")'; + $expression = '!$(this).prop("checked")'; } else if ($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()!="'. $dependency['Value'] .'"';