DEV Community


Discussion on: Autocomplete Dropdown using native HTML

danielperna84 profile image
Daniel Perna

One problem - at least depending on the use case - with this is, that it allows to send other values than those specified in the list. F.ex. imagine a UI to configure the listening IP for a daemon where the available options would be populated by the IPs available on the host. With a regular select the user can only choose valid options, whereas the datalist-solution allows him to enter and submit a custom value, which could be invalid. Obviously the server side should handle such cases. But I still think this is important to know.

tfisicaro profile image
Tim Fisicaro

When using a regular dropdown you can still change the option values and submit. Therefore you should always validate server side.