Is it possible to use CSS to disable autocomplete on a form element (specifically a textfield)?
I use a tag library which does not permit the autocomplete element and I would like to disable autocomplete without using Javascript.
Is it possible to use CSS to disable autocomplete on a form element (specifically a textfield)?
I use a tag library which does not permit the autocomplete element and I would like to disable autocomplete without using Javascript.
If you're using a
form
you can disable all the autocompletes with,you can easily implement by jQuery
Thanks to @ahhmarr's solution I was able to solve the same problem in my Angular+ui-router environment, which I'll share here for whoever's interested.
In my
index.html
I've added the following script:Then to cover state changes, I've added the following in my root controller:
The timeouts are for the html to render before applying the jquery.
If you find a better solution please let me know.
CSS does not have this ability. You would need to use client-side scripting.
I tried all suggested ways from this question answers and other articles in the web but not working anyway. I tried autocomplete="new-random-value", autocomplete="off" in form element, using client-side script as below but outside of $(document).ready() as one of the user mentioned:
I found maybe another priority in the browser cause this weird behavior! So I searched more and finally, I read again carefully below lines from this good article:
It's just worked. I tried in chrome specially and I hope this continues working and help others.