diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 2503d6bd59eb04ff195bda295ee0f946f50dfbe2..4a31eecd9e7dd97628837c6029d4829757592db5 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -1187,11 +1187,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) {