Have you ever had a form that needed to accept a short, arbitrary bit of text? Like a name or whatever. That's exactly what But this little story is about something else and applies to any of them. What if the text needs to be arbitrary (like "What's your favorite color?") so people can type in whatever, but you also want to be helpful. Perhaps there are a handful of really popular answers. Wouldn't it be nice if people could just select one? Not a That's what
Here are the basics: See the Pen The use case I was dealing with needed:
I probably wouldn't do a But for that second one, we only had maybe 3-4 unique flags we were dealing with at the time, so a datalist for those made perfect sense. You can type in whatever you want, but this UI helps you select the most common choices. So dang useful. Maybe this could be useful for something like a gender input, where there is a list of options you can choose, but it doesn't enforce you actually choose one of them. Even lesser known than the fact that The post Datalist is for suggesting values without enforcing values appeared first on CSS-Tricks. from CSS-Tricks https://css-tricks.com/datalist-is-for-suggesting-values-without-enforcing-values/ The following blog article Datalist is for suggesting values without enforcing values was initially seen on http://www.instant-web-site-tools/ from https://www.instant-web-site-tools.com/2019/07/26/datalist-is-for-suggesting-values-without-enforcing-values/
0 Comments
Leave a Reply. |