# Cake4: Datalist option in input field

**URL:** <https://discourse.cakephp.org/t/cake4-datalist-option-in-input-field/9372>\
**Category:** Uncategorized\
**Created:** [May 27, 2021, 7:15am UTC](https://discourse.cakephp.org/t/cake4-datalist-option-in-input-field/9372 "2021-05-27T07:15:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dirk/32/2174_2.png) [@dirk](https://discourse.cakephp.org/u/dirk)\
**Post date:** [May 27, 2021, 7:15am UTC](https://discourse.cakephp.org/t/cake4-datalist-option-in-input-field/9372/1 "2021-05-27T07:15:46Z")

</div>

At the Moment I have this form:

```
        <fieldset>
            <legend><?= __('Neues Allergen anlegen') ?></legend>
                <?= $this->Form->control('reference',['class'=>'input-text-one_third','label'=>__('Referenz'),'autocomplete'=>'off']) ?>
                <?= $this->Form->control('name',['class'=>'input-text-half','label'=>__('Bezeichung'),'autocomplete'=>'off','list'=>'allergens','onkeyup'=>'getallergen(this.value)']) ?>
                <datalist id="allergens"></datalist>
        </fieldset>

```

This forms works as expected, but I wonder if there is a special “CakePHP-Way” to define a datalist input field in cakephp?

I searched the official documentation, but did not find any results.

---

<div class="post-metadata">

**Author:** ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)\
**Post date:** [May 27, 2021, 2:47pm UTC](https://discourse.cakephp.org/t/cake4-datalist-option-in-input-field/9372/2 "2021-05-27T14:47:08Z")

</div>

This may be what you’re looking for?

[rrd108](https://github.com/rrd108) / **[cakephp-datalist](https://github.com/rrd108/cakephp-datalist)**
