Thursday 3 October 2013

Hiding the “Save and Close” button in Sharepoint 2010 and Sharepoint 2013


To hide the “Save and Close” button:

  1. Go to your designer
  2. On the left side click on “All Files”
    image
  3. Go to lists –> Select your survey-> And click on it.
  4. You will have the following pages (we only need to update two)
    image
  5. Right Click on NewForm.aspx->Open With->Sharepoint Designer(Open as text)
  6. Find the following line (section) : <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
  7. Copy this code below:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script>   
    $(document).ready(function () {
        $(":input").each(function () {                                   
    	var _sInputValue = $(this).val();                                        
    	if (_sInputValue==="Save and Close") $(this).hide();
        });
    });
    </script>

  8. Go to you NewForm.aspx on the designer, right click and “Check Out” and then “Check In”

  9. Do the same with EditForm.aspx