From a7e5726f39a62362df7b236af3e2953ce3126862 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 16 Apr 2020 18:39:56 +0000 Subject: [PATCH] form : disable the label linking to checkboxes and radio if more than 1 checkbox/radio is set git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5929 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- form.php | 74 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 24 deletions(-) diff --git a/form.php b/form.php index 919d446..0de6f99 100644 --- a/form.php +++ b/form.php @@ -781,6 +781,8 @@ 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 (""); $res = ""; $res .= "
\n"; if ($this->label !== "") { - $res .= " \n"; } $res .= "
\n"; - if (! is_array ($this->titles) || count ($this->titles) === 0) - $this->titles = array (""); foreach ($this->titles as $key=>$val) { $res .= "
\n"; @@ -818,9 +823,9 @@ class formfield $res .= "' value='unset'"; $res .= "/>"; $res .= "