public function set_type_autocomplete($options, $attributes) {
        $this->type = 'autocomplete';

        $pairedoptions = [];
        foreach ($options as $key => $value) {
            $pairedoptions[] = [
                'key' => $key,
                'value' => $value,
            ];
        }
        $this->options = json_encode(['options' => $pairedoptions, 'attributes' => $attributes]);
        return $this;
    }