Remove “Save and Close” button on the SharePoint 2010 Survey List

Occasionally when using survey lists in SharePoint, there will be requirements to customize the OOTB look and feel and functionality.  One repeating question has been  “How do I remove or  hide the ‘Save and Close’ button”?    Well,  here’s a simple javascript function that does just that.

1) Open the Survey List in SharePoint Designer

2) Under the Forms section, right-click the NewForm.aspx and select “Edit in Advanced Mode” ( it’s wise to do a backup of the file first, just to be safe) .

3) Find the end </asp:Content> tag of the PlaceHolderMain section.

4) Insert the following script above the </asp:Content> line:

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

5) Save the file

6) Repeat steps  2-5 for EditForm.aspx

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s