ben tedder

Create a feedback button for Sharepoint 2010

Ever want to get feedback from your users without making them go through some laborious process of filling out a survey or sending an email to the helpdesk?

Introducing: the feedback button. It allows your users, no matter what page they are on, to submit their feedback. I've found this to be an extremely useful tool for gathering, you guessed it, feedback. And now I'll teach you how to create one.

Click below to skip ahead:
Create a new list: feedback
Apply the workflow
Edit your master page


Create a new list: feedback


The first step in making this feedback button is to make a custom list into which your feedback will be input. For my list I have two columns. The first column (renamed the required "title" column) is "What page are you on?" I haven't made the system intelligent, I'm leaving it up to the user to tell me where they are on the site. You never know, it could provide a little hint if they have no idea where they are, or they think they are somewhere they are not. The second column I create is a multi-line textbox column called "Comments". That's all I want from my users. Their feedback. Simple.

List Settings

  • Turn approval off, turn off version history
  • Item-level read permissions: read items that were created by the user
  • Item-level create/edit permissions: create items and edit items that were created by the user
  • Disable items to show in search results

Permissions
You'll want to break permissions on this specific list and allow your users to have contribute permissions on this list alone. Otherwise they will not be able to submit items when they click the feedback button.


Apply the workflow


Create a new workflow on this list called "Feedback Workflow". I always turn the start options to "start automatically when item is created". That is really the only scenario with this list.

There is only one step in the workflow, and it should be an "email" step. If you check out my settings, I have put the contents of the comment box, including who wrote it, when they created it, and the page they were on.

Don't forget to save and publish the workflow!


Edit your master page

<p>
  </a><br /> This bit is slightly tricky. Not only do you need to put the button on your master page sidebar, but it needs to open the form in a modal dialog box window (at least that's my preference). So below you'll see the javascript I use to enable that dialog box on the link:
</p>

<pre><code >&lt;div class="feedback"&gt;&lt;a href="javascript;" onClick="javascript:SP.UI.ModalDialog.showModalDialog({ url: '/Lists/Feedback/NewForm.aspx', title: "Add item' }); return false;"&gt;&lt;h4&gt;Questions?&lt;/h4&gt;&lt;span&gt;Click to send feedback&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</code></pre>

<p>
  Also, for some reason you want to style your feedback button like mine is style, here's my CSS:
</p>

<pre><code >.feedback {
margin-top:10px;
text-align:center;

} .feedback a { text-decoration:none; color:inherit; background:transparent url('/Style Library/images/feedback.png') no-repeat top center; display:block; height:40px; } .feedback a:hover { background:transparent url('/Style Library/images/feedback.png') no-repeat bottom center; } .feedback a h4 { color:#FFFF99; font-family:'Ubuntu Bold'; font-weight:bold; font-size:1.3em; padding-top:2px; } .feedback a span { color:#ffffff; font-size:0.9em; }