With the introduction of Microsoft SharePoint 2010 more people are using this platform as the basis for their websites and one of the main requirements of any website is a contact us form that an anonymous user can fill in.
These steps show how this was achieved at West Hatch High School.
Create a Custom List
The first step is to create a custom list that contains all the fields you want the user to fill in, here is our prospectus download form columns
This will work fine apart from the fact that when a user submits the form it will take them to the list view
To get around this issue you need to create a link that will open the form for adding an item but when the user click Submit it takes them to a non descript landing page. The link should look like this:
/ContactUs/Lists/ContactData/NewForm.aspx?Source=/ContactUs/Pages/ContactThank.aspx
When the user clicks on the link they will get the form to complete but once they click on Submit they will be taken to a page that says thank you for submitting their details.
You need to have created this landing page and put it in the location specified in the link.
Anonymous Access
Now this is all well and good but at the moment you have to be signed into the site to use the form. You need to enable anonymous access on the site that contains the list.
If your site is already setup for anonymous access (as most websites will be) then you only need to be aware of a few minor caveats
Inheritance
In the list settings you need to turn off permission inheritance and enable anonymous access on the list itself
This will enable you to allow anonymous users to add items to a list, inherited anonymous access only allows anonymous users to read list items
Publishing Portal Lockdown
Another feature of SharePoint 2010 is the lockdown feature. This feature, even with anonymous access enabled, will not allow any anonymous users to add items to lists.
If you have setup your list and it still keeps asking you to sign in then you need to check if the lockdown feature is enabled and if it is, disable it.
To check if its enabled run this PowerShell command on the SharePoint App server
get-spfeature –site http://siteurl
If ViewFormPagesLockDown is listed then its enabled
To disable it run these two PowerShell commands
$lockdown = get-spfeature viewformpageslockdown
disable-spfeature $lockdown –url http://siteurl
Your anonymous users should now be able to fill in the contact form without any need to sign into the site







13 comments
2 pings
Justin says:
October 1, 2010 at 1:32 AM (UTC 0 )
I have anonymous access for the site on, and when I try to modify those permissions for a specific list, all of the check boxes are greyed out. Am I missing something?
arichards_Saruk says:
October 12, 2010 at 3:22 PM (UTC 0 )
Have you changed any of the settings of the list so that user can only edit their own entries. Only problem is this doesn;t work with anon access.
Cader says:
October 20, 2010 at 8:08 AM (UTC 0 )
Hi,
I made the site anonymous and Custom List is working perfect in the site. Thanks
My question is,
I am creating a Silverlight application using SharePoint List. It is asking for authentication when I try to launch the application. I am trying to connect Sharepoint List using webservice created in Sharepoint.
Silverlight Code:
var proxy = new SPListServices.ListsSoapClient();
XElement query = XElement.Parse(@”");
XElement fields = XElement.Parse(@”
“);
XElement queryOptions = XElement.Parse(@”");
proxy.GetListItemsAsync(“TeamStructure”, null, query, fields, null, queryOptions, null);
Need your help
Mark says:
December 28, 2010 at 6:14 PM (UTC 0 )
Hi, this works nice
Except that now anonymous users have view access to the list, and can see all the items. Is there a way to give anonymous users the right to add a list item, but not to view the rest of the list?
arichards_Saruk says:
January 2, 2011 at 9:45 PM (UTC 0 )
As far as I know you can’t get around this. However I make sure that anonymous users can’t use the view all site content link and also redirect them back to a ‘thank you’ page once the form has been filled in, this way they never see the list after completing the form.
Geeshan says:
December 22, 2011 at 6:21 AM (UTC 0 )
Actually there is a work around for this. Just use the following code in your web.config.
This will deny access to the allitems view for all anonymous users.
However this will not protect you from search engine requests like google, since the anonymous access is enabled in the list, so that all your contact details will be nicely listed on google. To overcome this you will have to edit the robot file in the root with appropriate settings.
Geeshan says:
December 22, 2011 at 6:24 AM (UTC 0 )
Code
”
“
Geeshan says:
December 22, 2011 at 6:26 AM (UTC 0 )
Seems that html tags are not working. Please replace the # with < and @ with /@
#location path="Lists/Contact Us/AllItems.aspx"@
#system.web@
#authorization@
#deny users="?" /@
#/authorization@
#/system.web@
#/location@
Christophe says:
April 19, 2011 at 6:12 AM (UTC 0 )
I agree with Cader’s comment, and I don’t think security by obscurity is a good practice.
Dave Coleman once said he had a solution for contact forms, but he never published the article:
http://www.endusersharepoint.com/2010/11/18/can-sharepoint-be-used-for-websites/comment-page-1/#comment-112888
arichards_Saruk says:
April 19, 2011 at 8:00 AM (UTC 0 )
I agree with Christophe that it’s not ideal and have been looking for a way round it for a while, but not succeeded yet. The form has now been taken of the site as it hardly got used and replaced with a simple email form so no data is kept on the site.
LUIS ANGEL CAMARGO FONSECA says:
July 18, 2011 at 11:17 PM (UTC 0 )
nice and easy solution. It works just fine in a Intranet too. Thanks.
johannes gnaegi says:
September 29, 2011 at 6:37 AM (UTC 0 )
Article was really helpful, the part with the Publishing Portal Lockdown I found just on your Page and was exactly what i needed.
I understand the problem with the access to the list for anonymous users, but there is a nice trick how i solved it, it’s not really the most proper solution i know.
if your anonymous users can’t do anything if they reach the Contactform-List, recreate the view of this list. Make sure you have just one view, then edit it that there is just one field marked (you can use title if it’s not filled out, or date….). If a user now reaches the list he sees just the Date when the other items are created but can’t open nor edit nor anything else do with it:-)
So if anyone uses the sharepoint builtin functionalities this could be a way to make it as save as possible..
Steve says:
January 3, 2012 at 10:01 AM (UTC 0 )
Sapiens published a web part to create a contact form or any other form anonymous users are able to fill out without granting them access to the list behind it:
http://www.sapiens.at/en/products/pages/sharepoint-form-web-part.aspx
Creating A Contact Form In SharePoint 2010 - Learning Gateway Partner Blog - Microsoft Education Community says:
August 11, 2010 at 12:46 PM (UTC 0 )
[...] July 2010 (13)June 2010 (13)May 2010 (2)April 2010 (8)March 2010 (21)February 2010 (10)January 2010 (9)December 2009 (1)November 2009 (2)October 2009 (12)September 2009 (16)August 2009 (3)July 2009 (4)June 2009 (4)May 2009 (12)March 2009 (4)August 2008 (1) With the introduction of Microsoft SharePoint 2010 more people are using this platform as the basis for their websites and Read the Rest… Read More… [...]
Tweets that mention Creating A Contact Form In SharePoint 2010 | Education Technology Now -- Topsy.com says:
August 11, 2010 at 1:10 PM (UTC 0 )
[...] This post was mentioned on Twitter by Education Technology, Alan Richards. Alan Richards said: New Blog Post: SharePoint 2010 anonymous access contact forms and Publishing Portal LockDown feature http://edutechnow.com/?p=253 #SP2010 [...]