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:
- Upload the JavaScript file to your Style Library
- Place a Content Editor Web Part on your New & Edit forms for your survey
- Link the Content Editor Web Parts to the JavaScript file
- 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>
<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