You are on page 1of 3

1) Steps to Disable Autocomplete feature in Sharepoint

Application

Recommendations include setting Autocomplete to off on all your forms


Or
Writing custom code to override the Auto complete feature.
Here is some SAMPLE CODE that can be used in conjunction with a client created
custom.js to override the Autocomplete feature in SharePoint:
1. Create feature files that will inject content into the master page
"AdditionalPageHead" section.
2. Create a new feature folder under SharePoint. Add the Feature.xml and
CustomSchema.xml files like below:
TEMPLATE\FEATURES\DelegateControl\feature.xml
Feature.xml
===================
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="<GUID>"
Title = "AUTOCOMPLETE Disable"
Description = "AUTOCOMPLETE Disable"
Creator = "creatorName"
Version = "1.0.0.0"
DefaultResourceFile=" "
Hidden ="TRUE"
Scope="WebApplication"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="CustomSchema.xml" />
</ElementManifests>

</Feature>

CustomSchema.xml
=====================
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Control Id="AdditionalPageHead"
Sequence="80"
ControlSrc="~/_controltemplates/custom/custom.ascx">
</Control>
</Elements>

3. Create a custom.ascx file and place it in the


TEMPLATE\CONTROLTEMPLATES\custom\ directory of the 12 hive
Custom.ascx
====================
<%@ Control Language="C#" %>
<script type="text/javascript"
src="/_layouts/Custom/Custom.js" defer="true"></script>
4. Create your custom.js and place it in the Layouts/Custom/ directory of the 12
hive
Custom.js
====================
if (document.getElementsByTagName) {
var forms = document.getElementsByTagName("form");
for (var i=0; i<forms.length; i++) {
forms[i].autocomplete = "off";
}
}

For more information, refer to:


http://support.microsoft.com/kb/970782

You might also like