diff --git a/code/UserDefinedForm.php b/code/UserDefinedForm.php index cb6b559..0b8b54c 100755 --- a/code/UserDefinedForm.php +++ b/code/UserDefinedForm.php @@ -379,9 +379,25 @@ class UserDefinedForm_Controller extends Page_Controller { $expression = ($checkboxField) ? '$(this).attr("checked")' : '$(this).val() == "'. $dependency['Value'] .'"'; break; + case 'ValueLessThan': + $expression = '$(this).val() < parseFloat("'. $dependency['Value'] .'")'; + + break; + case 'ValueLessThanEqual': + $expression = '$(this).val() <= parseFloat("'. $dependency['Value'] .'")'; + + break; + case 'ValueGreaterThan': + $expression = '$(this).val() > parseFloat("'. $dependency['Value'] .'")'; + + break; + case 'ValueGreaterThanEqual': + $expression = '$(this).val() >= parseFloat("'. $dependency['Value'] .'")'; + + break; default: $expression = ($checkboxField) ? '!($(this).attr("checked"))' : '$(this).val() != "'. $dependency['Value'] .'"'; - + break; } // put it all together diff --git a/code/editor/EditableMultipleOptionField.php b/code/editor/EditableMultipleOptionField.php index c8743a1..a170dc2 100644 --- a/code/editor/EditableMultipleOptionField.php +++ b/code/editor/EditableMultipleOptionField.php @@ -46,6 +46,7 @@ class EditableMultipleOptionField extends EditableFormField { $option->publish($fromStage, $toStage, $createNewVersion); } } + parent::publish($fromStage, $toStage, $createNewVersion); } diff --git a/javascript/UserForm.js b/javascript/UserForm.js index 371b5d7..ce9612d 100644 --- a/javascript/UserForm.js +++ b/javascript/UserForm.js @@ -234,7 +234,7 @@ */ $(".customRules .conditionOption").livequery('change', function(){ var valueInput = $(this).siblings(".ruleValue"); - if($(this).val() == "ValueNot" || $(this).val() == "HasValue") { + if($(this).val() != "" && $(this).val() != "IsBlank" && $(this).val() != "IsNotBlank") { valueInput.removeClass("hidden"); } else { diff --git a/templates/EditableFormField.ss b/templates/EditableFormField.ss index 550b38e..ee8547d 100755 --- a/templates/EditableFormField.ss +++ b/templates/EditableFormField.ss @@ -106,6 +106,10 @@ + + + + diff --git a/templates/Includes/CustomRule.ss b/templates/Includes/CustomRule.ss index 22b6be9..4a960b2 100644 --- a/templates/Includes/CustomRule.ss +++ b/templates/Includes/CustomRule.ss @@ -13,11 +13,14 @@