From b589759193db92c7839f5d5d5d926733a7e76d26 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Thu, 23 Apr 2020 19:39:49 +0200 Subject: [PATCH] fix date and time inputs --- classes/document.php-class | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/classes/document.php-class b/classes/document.php-class index f215f7b..a0800f2 100755 --- a/classes/document.php-class +++ b/classes/document.php-class @@ -554,23 +554,25 @@ class ExtendedDocument extends DOMDocument { } public function createElementInputDate($name, $id = null, $min = null, $max = null, $value = null) { - $telfield = $this->createElement('input'); - $telfield->setAttribute('type', 'date'); - if (!is_null($id)) { $telfield->setAttribute('id', $id); } - if (!is_null($min)) { $rgfield->setAttribute('min', $min); } - if (!is_null($max)) { $rgfield->setAttribute('max', $max); } - if (!is_null($value)) { $telfield->setAttribute('value', $value); } - return $telfield; + $dtfield = $this->createElement('input'); + $dtfield->setAttribute('type', 'date'); + if (!is_null($id)) { $dtfield->setAttribute('id', $id); } + $dtfield->setAttribute('name', $name); + if (!is_null($min)) { $dtfield->setAttribute('min', $min); } + if (!is_null($max)) { $dtfield->setAttribute('max', $max); } + if (!is_null($value)) { $dtfield->setAttribute('value', $value); } + return $dtfield; } public function createElementInputTime($name, $id = null, $min = null, $max = null, $value = null) { - $telfield = $this->createElement('input'); - $telfield->setAttribute('type', 'time'); - if (!is_null($id)) { $telfield->setAttribute('id', $id); } - if (!is_null($min)) { $rgfield->setAttribute('min', $min); } - if (!is_null($max)) { $rgfield->setAttribute('max', $max); } - if (!is_null($value)) { $telfield->setAttribute('value', $value); } - return $telfield; + $timefield = $this->createElement('input'); + $timefield->setAttribute('type', 'time'); + if (!is_null($id)) { $timefield->setAttribute('id', $id); } + $timefield->setAttribute('name', $name); + if (!is_null($min)) { $timefield->setAttribute('min', $min); } + if (!is_null($max)) { $timefield->setAttribute('max', $max); } + if (!is_null($value)) { $timefield->setAttribute('value', $value); } + return $timefield; } public function createElementInputColor($name, $id = null, $value = null) { -- 2.43.0