17
I know the attribute can be used in the element input
<input type="text" name="email" autocomplete="on" />
According to the MDN Web Docs, the element textarea
includes the global attributes to which autocomplete
but when testing in version 59.0.3 (64-bit) of Firefox, just didn’t work:
<textarea name="mensagem" autocomplete="on"></textarea>
See that in the session Browser Compatibility is said to work in the Firefox from the version 59, and researching on Google found places talking that works in Chrome from the version 66, but tested in version 66.0.3359.139 (Official version) 64 bits and it didn’t work either.
Already in the community WHATWG, it is stated that the attribute can be assigned both in elements textarea
as in the elements select
, but both do not work.
<select name="cor" autocomplete="on">
<option value=""></option>
<option value="Azul">Azul</option>
<option value="Preto">Preto</option>
<option value="Verde">Verde</option>
</select>
The question: I’m making the right use ?
I’m on my cell phone and I can’t get a good look, but it seems element interface defines the autocomplete as experimental, then you may need to enable support in your browser settings.
– Woss
In select how would the autocomplete look? You want the user to type and already appear the combo options making a type of filter. Type starts typing the letter "A" and appears in combo the color "Blue" for example?
– hugocsl
In the documentation is written: "
on
: The browser can automatically complete the value based on the values the user entered in previous sessions". That’s the behavior you’re testing?– Pagotti
@hugocsl this autocomplete will be the same as the
input
I believe, I believe it will be the browser standard, but as stated in the question, the documentation says that the attribute can be used in both elements, but it does not work in either of them.– NoobSaibot
Dude I don’t understand right rss, but it seems like you want a
<datalist>
and not a<select>
...– hugocsl
http://www.endreywalder.com/blog/html5-autocomplete-with-optional-select/
– Israel Zebulon
@hugocsl no, it’s not
datalist
see the reference links I mentioned, see the attributeautocomplete
– NoobSaibot
There is a way to do this through a Jquery library. http://api.jqueryui.com/autocomplete/ Follow below link of this working example. http://output.jsbin.com/cezemetida/1 Here’s the Stackoverflow response link. https://stackoverflow.com/questions/2518442/autocomplete-functionality-on-a-textarea A hug !
– Luciano Oiticica Lemgruber