Idea: Support Datalists for HTML Text inputs

filisko
Member | 9
+
0
-

Hi,

Was thinking given a need I had, that supporting the so-called “text suggestions” / datalists natively would be a good idea.

$form->addText('language', 'Language:')->setDatalist([...]);

Should generate something like…

<input type="text" list="programmingLanguages" placeholder="Enter Here" />
<datalist id="programmingLanguages">
    <option value="Objective C">Objective C</option>
    <option value="C++">C++</option>
    <option value="C#">C#</option>
    <option value="Cobol">Cobol</option>
    <option value="Go">Go</option>
    <option value="Java">Java</option>
    <option value="JavaScript">JavaScript</option>
    <option value="Python">Python</option>
    <option value="PHP">PHP</option>
    <option value="Pascal">Pascal</option>
    <option value="Perl">Perl</option>
    <option value="R">R</option>
    <option value="Swift">Swift</option>
</datalist>

More: https://www.geeksforgeeks.org/…eld-in-html/

Thank you!