From 8495ce241b93a788d18d29707b76f8be4a40dd75 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 1 Dec 2017 08:36:01 +0000 Subject: [PATCH] form: select field : allow the provided value to be an integer and work correctely in comparison with the string defaults values git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4005 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- form.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/form.php b/form.php index 15f4f84..a0ae83a 100644 --- a/form.php +++ b/form.php @@ -790,6 +790,10 @@ class formfield is_string ($this->values) && $this->values == $key) $res .= " selected='selected'"; + elseif (isset ($this->values) && + is_integer ($this->values) && + $this->values == $key) + $res .= " selected='selected'"; elseif (isset ($this->values) && is_array ($this->values) && in_array ($key, $this->values))