Cake4: Datalist option in input field

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.

This may be what you’re looking for?

rrd108 / cakephp-datalist

1 Like