HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/slfopp7cb1df/www/sitepacket.com/system/app/Views/custom_fields/input_multi_select.php
<?php
$uid = "_" . uniqid(rand());

$options = $field_info->options ? $field_info->options : "";
$options_array = explode(",", $options);

$options_dropdown = array();
if ($options && count($options_array)) {
    foreach ($options_array as $value) {
        $options_dropdown[] = array("id" => $value, "text" => $value);
    }
} else {
    $options_dropdown = array(array("id" => "-", "text" => "-"));
}

echo form_input(array(
    "id" => "custom_field_" . $field_info->id . $uid,
    "name" => "custom_field_" . $field_info->id,
    "value" => isset($field_info->value) ? $field_info->value : "",
    "class" => "form-control validate-hidden",
    "placeholder" => $placeholder,
    "data-rule-required" => $field_info->required ? true : "false",
    "data-msg-required" => app_lang("field_required"),
    "data-custom-multi-select-input" => 1
));
?>

<script type="text/javascript">
    $(document).ready(function () {
        $("#custom_field_<?php echo $field_info->id . $uid; ?>").select2({data:<?php echo json_encode($options_dropdown); ?>, tags: true});
    });
</script>