Howto disable autocomplete for an entire SharePoint farm

Article ID: 970782 - View products that this article applies to.
Expand all | Collapse all
Source: Microsoft Support

RAPID PUBLISHING

RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.

Symptom



Some 3rd party security applications will flag the built in AutoComplete SharePoint functionality as a security risk when users access the SharePoint resources on a public machine.

Resolution



Recommendations include setting autocomplete to "off" on all your forms. 

Or, writing some custom code to override the 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>

2. 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>

3. 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";
  }
}

More Information



Feature Element (Feature) http://msdn.microsoft.com/en-us/library/ms436075.aspx

DISCLAIMER

MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.

Properties

Article ID: 970782 - Last Review: April 29, 2009 - Revision: 1.0
APPLIES TO
  • Microsoft Windows SharePoint Services 3.0
  • Microsoft Office SharePoint Server 2007
Keywords: 
kbrapidpub kbnomt KB970782

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com