diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index fcbeeb897a8a9e358e03e065de9216f1bdd7ce68..5cf90a011274ecc462a438845057f4c442bf1d21 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -1169,11 +1169,12 @@ class SelectionField extends FormField {
     function parse($value) {
         $config = $this->getConfiguration();
         if (is_int($value))
-            return $this->to_php($this->getWidget()->getEnteredValue(), (int) $value);
+            $val = $this->to_php($this->getWidget()->getEnteredValue(), (int) $value);
         elseif (!$config['typeahead'])
-            return $this->to_php(null, (int) $value);
-        else
-            return $this->to_php($value);
+            $val = $this->to_php(null, (int) $value);
+        if (!$val)
+            $val = $this->to_php($value);
+        return $val;
     }
 
     function to_php($value, $id=false) {