Showing posts with label SharePoint Survey. Show all posts
Showing posts with label SharePoint Survey. Show all posts

Friday, January 17, 2014

How To Hide Save & Close For Surveys Using JavaScript

Hello Inter-webs!

Why Hide The Save & Close Button?

Before I jump into the how, lets talk about the why.  The main reason to hide the Save and Close button is due to the issues it causes for Site Admins and their users.  When a user selects Save and Close instead of selecting Finish, SharePoint treats the survey response as a working draft.  That means that the only individual who can actually access or even see the survey is the individual who created it.  Even as a site collection administrator you can only see the correct number of surveys by navigating to the /_layouts/viewlsts.aspx.  This will show you the total responses including the "drafts" but you still can't access them, so its better to hide the button all together!


How To Hide The Save and Close Button

To hide the Save and Close button you will need to:

  1. Upload the JavaScript file to your Style Library
  2. Place a Content Editor Web Part on your New & Edit forms for your survey
  3. Link the Content Editor Web Parts to the JavaScript file
  4. Hide each Content Editor Web Part
JavasScript Needed:  Save this Script into a .txt file and save it to your Assets Library

<script type=”text/javascript”>
 var x=document.getElementsByTagName(“input”);
 for (var i=0; i<x.length; i++)
 {
 if (x.item(i).type==”button” && x.item(i).value==”Save and Close”)
 {
 x.item(i).style.display=”none”;
 }
 }
 </script>


Cheers!
Dan

Tuesday, June 4, 2013

How to Create Views On Surveys


Hello!

 

I learned this trick today (thanks Jamie!) and wanted to share it in a blog post.  I am sure that we have all ripped out our hair before trying to understand why SharePoint does not give a way to create views of Survey Data or be able to view it in a list, well no more!

In order to create the views you will need:


1.    A Survey

2.    That’s it, this trick is super simple once you know it


Steps:

1.    Navigate to your survey

2.    Select Survey Settings

3.    Copy the URL from your browser (it should look similar to this)


b.    We do this in order to get the list ID, there are other ways but this is fairly quick

4.    Next we are going to change the URL to remove “survedit” to “viewtype”


5.    Bask in the awesomeness!  From this page you can create the views just like any other list or library






From these views you can run your exports just like any other list or library

 
Cheers!
Dan

Thursday, April 18, 2013

SharePoint 2010 Surveys & How to Fix the Rating Scale Spacing


I recently have been asked to create surveys to capture this and that and the most commonly used question in my experience is the rating scales, but this question type is also the cause of an issue.  The issue is that longer questions within the scale get smashed together like I have shown below and make it nearly unreadable.  In this article I will show you how to fix this issue.



To Fix This Issue You Will Need:
1.    SharePoint 2010
2.    A Survey
3.    A question using rating scales
4.    SharePoint Designer
5.    This Code Block:
<style>
.ms-gridT1 { padding-top: 10px; padding-bottom: 10px; }
</style>

After you have created the Survey and you have questions which utilize the rating scale, you will need to open SharePoint Designer.

From SharePoint designer navigate to your site and then open the survey under lists and libraries.



The next set of steps will need to be done for the “DispForm.aspx”, “EditForm.aspx”, & “NewForm.aspx”.

To increase the padding between questions:
!1.    Right Click the NewForm.Aspx & edit in advanced mode
2.    Set the View to either Code or Split
3.    Find the Tags <ContentTemplate></ContentTemplate>
4.    Place the provided code block within these tags like the image below:
a.    

5.    Right Click the form tab and select save.
6.    Say Yes to the following message
a.    

7.    Navigate to your site and pull view the form (whichever form you did these steps for, I happened to do the newform for this example) and it should look like the below screen shot

!!!Please Note!!!!!
You will have to do this process for each of the forms within your survey.  In this example I did the newform, but if I were to view the item using the viewform, the questions would be smushed since we have not modified that display form.

I hope this helps and enjoy the easy to read surveys!

Dan