Reputation: 3339
Is there a way to turn off auto-complete on an input-field using jQuery?
Like this:
<input type="text" autocomplete="off" />
Upvotes: 1
Views: 702
Reputation: 4498
"autocomplete" isn't a standard attribute. Yes it's implemented, but it's not proper XHTML.
Do you have to do it client-side? Can you make changes on the server-side if necessary?
Upvotes: 1
Reputation: 89169
For any text field, you could do this.
$("input[type=text]").attr("autocomplete", "off");
Hope this helps!
Upvotes: 2
Reputation: 13226
$('input#id').attr('autocomplete', 'off');
You can also use a common class to turn off a group of fields. There are a few ways to do it though as you'll see from the answers.
Upvotes: 2