diff --git a/lib/FormBuilder.lib.php b/lib/FormBuilder.lib.php
index c9d0932..e14c8ce 100644
--- a/lib/FormBuilder.lib.php
+++ b/lib/FormBuilder.lib.php
@@ -77,7 +77,7 @@ class FormBuilder {
*
* @param string $name Element name
* @param string $value Element value
- * @param string $type Input type (text, number, date, select, tel...)
+ * @param string $type Input type (text, number, date, select, datalist (with text input), tel...)
* @param bool $required If the element is required for form submission.
* @param string $id Element ID
* @param array $options Array of [value => text] pairs for a select element
@@ -104,7 +104,7 @@ class FormBuilder {
if (!empty($id)) {
$item["id"] = $id;
}
- if (!empty($options) && $type == "select") {
+ if (!empty($options) && ($type == "select" || $type == "datalist" || $type == "select2")) {
$item["options"] = $options;
}
if (!empty($pattern)) {
@@ -231,11 +231,15 @@ ITEMTOP;
INPUTG;
+ $extraclass = "";
switch ($item['type']) {
+ case "select2":
+ $extraclass = " select2";
case "select":
$itemhtml .= $inputgrouptop;
+
$itemhtml .= <<