From a86d6fae4bdd6c8912f69dec89fc76113e3ee14c Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 24 Aug 2020 09:29:52 +0000 Subject: [PATCH] form : manage correctely the form focus if the first field is a checkbox git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@6034 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- form.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/form.php b/form.php index 0de6f99..2d3c951 100644 --- a/form.php +++ b/form.php @@ -782,7 +782,9 @@ class formfield // No $this->multiple, $this->rows $this->cols $this->placeholder, // $this->maxlength if (! is_array ($this->titles) || count ($this->titles) === 0) - $this->titles = array (""); + $titles = array (""); + else + $titles = $this->titles; $res = ""; $res .= "
fieldwidth'>\n"; - foreach ($this->titles as $key=>$val) + foreach ($titles as $key=>$val) { $res .= "
\n"; $res .= " name, ENT_QUOTES)."]"; - if (count ($this->titles) > 1) + if (count ($titles) > 1) $res .= "[$key]"; $res .= "' value='unset'"; $res .= "/>"; $res .= "