+ Start a Discussion
yuzhaoyuzhao 

Does anyone know how to disable the autocomplete function

Hi guys,

I want to replace the autocomplete function generated by salesforce of a <apex:inputField>. Does anyone know how to disable the autocomplete function of a <apex:inputField> generated by salesforce?

Andy BoettcherAndy Boettcher

Autocomplete is more of a client-side thing that unfortunately does not have a standards-based method/attribute to disable.  Outside of Salesforce, you can put non-standard attributes on <input> tags, but the results are spotty.

 

<inputtype="text"id="cardNumber"name="cardNumber"autocomplete='off'/>

There is an Idea out on the IdeaExchange regarding this - and you can follow the commenter's suggestion of using some JS to add the attribute after page load.

 

http://success.salesforce.com/ideaView?id=0873000000078Ro

Neha Jain 2Neha Jain 2
You can use html-autocomplete="off" attribute to disable it
Matthew StroudMatthew Stroud
html-autocomplete="off" doesn't work with the apex:inputsecret, this is presenting a major issue as we are getting a pre-popluated 'previous password' field on our reset password page.  the inputsecret redisplay attribute doesn't seem to render any html at all.
Sayed DanishSayed Danish
Please use html-autocomplete="true" with <apex:inputField>.