locked
How can you remove the Save button on a survey? RRS feed

  • Question

  • What options are there to remove the SAVE button from a SharePoint survey?

    I need to remove this if possible, I was hoping it would be as simple as editing a form in the Survey list... but that is apparently not the case.

    I need to supress the SAVE button as it confuses end users and we don't want any half completed surveys. Either it gets finished or not at all.

    Can someone hopefully provide me with an nice simple solution?  Or any solution at all :)

    Thanks!
    • Edited by Mike Walsh FIN Tuesday, April 7, 2009 6:22 PM No need to shout SAVE at us so many times. Removed from Title
    Tuesday, April 7, 2009 3:58 PM

Answers

  • Hi,


    Save button on the surveys with multiple question or with branching logic enabled is an out of the box feature and it is by design.

    If you want to remove the “save” button in a survey, I think you can use JavaScript to hide this button:

    1. Open your site in SharePoint Designer.

    2. Open your survey list newform.aspx page, in the code view, find this code “<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> <table>……. </table> “add the JavaScript” </asp:Content>”, add JavaScript before the “</asp:Content>” tag:

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


    After this, you will not see the “Save” button when create new survey response. You can also add this JavaScript in the editform.aspx page.

    Hope it can help you.

     


    Xue-Mei Chang
    Thursday, April 9, 2009 3:45 AM
    Moderator

All replies

  • Hi,

    There's an example of how to do it using JQuery from End User SharePoint:
    http://www.endusersharepoint.com/?p=1371
    But I have a personal prejudice agains JQuery so I wouldn't do that but it does work.

    Or you can use the dataview webpart to create a new "newform.aspx".  That way you can get people to fill in the survey and add buttons to do whatever you want.

    Mike
    Wednesday, April 8, 2009 10:08 AM
  • Hi,


    Save button on the surveys with multiple question or with branching logic enabled is an out of the box feature and it is by design.

    If you want to remove the “save” button in a survey, I think you can use JavaScript to hide this button:

    1. Open your site in SharePoint Designer.

    2. Open your survey list newform.aspx page, in the code view, find this code “<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> <table>……. </table> “add the JavaScript” </asp:Content>”, add JavaScript before the “</asp:Content>” tag:

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


    After this, you will not see the “Save” button when create new survey response. You can also add this JavaScript in the editform.aspx page.

    Hope it can help you.

     


    Xue-Mei Chang
    Thursday, April 9, 2009 3:45 AM
    Moderator
  • Hi Xue-Mei
    I tried your script and it worked great except that it only seems to work for the first page of the survey.
    So if your using branch logic and have several pages then this doesn't do the trick...unless I'm missing something easy
    Monday, April 27, 2009 6:56 AM
  • Thank you.  I used Xue-Mei's script too but it also only worked for the first page of my survey.  Can anyone provide further info on getting the Save buttons off the remaining pages.  By the way, I'm not a programmer but I did try the solution offered at http://www.endusersharepoint.com/?p=1371 but alas I failed!
    Tuesday, August 4, 2009 5:06 AM
  • Hi, if its only working on your first page you did everything right. It seems that you've only modified the newform.aspx but you have also to modifiy the editform.aspx in the same way.

    Look at your URL during the survey, it's only the newform for the first page, the following questions are on the editform.

    Regards simon
    Friday, December 11, 2009 9:46 AM
  • This worked beautifully for me

    Thanks!

    PS  Remeber to do this for BOTH the newform.aspx and editofrm.aspx pages

    Tuesday, May 11, 2010 12:32 PM
  • This works, but what about for new surveys, where some "power-user" has the ability to create surveys. Is there a way to automatically "deploy" this script to every survey that is created by the user?
    Friday, June 25, 2010 3:37 PM
  • simple trick for this, you can do this by saving the list as a template then create a new survey using the saved template your javascript will reflect for the newly created surveys and works fine.
    Monday, September 13, 2010 7:20 PM
  • You can hide the "Save and Close" button from the user.  However, I discovered that the "Cancel" button and the "X" button would also save the incomplete survey.  And we still can't see the response.

    Solution #1: create a survey with no page separators or branching.  (the above only happens with surveys that contain these things)

    Solution #2: if you must have a survey with page separators or branching, the only way to view both complete and incomplete survey responses is to create the survey on a collaboration/team site type.

    Thursday, July 24, 2014 2:37 PM
  • So how did you hide the "Save and Close" button?  I'm looking for an easy way (.css or js in a content editor web part).
    Tuesday, April 21, 2015 10:30 PM
  • Tuesday, June 2, 2015 9:11 AM