Is it possible to remove the 'Save' button from the bottom of surveys? If so, how?

brocoppler
ServiceNow Employee
ServiceNow Employee

At the bottom of surveys there is 'Submit', 'Save', and 'Cancel' and I want to remove the 'Save' button.

Thanks!

1 ACCEPTED SOLUTION

It will depend on what version of survey you use. If you look around your "Survey Instance" page, you will stumble across something to the effect of "Take Survey" or "View Public URL".



There are quite a few places. I just double checked ours, and "survey.do" was a copy we made for a custom one. My apologies, your instance would not have that one!




The one that comes OOB with Assessments is "assessment_take2.do" and for Legacy Surveys is "survey_take.do" (I just double checked). If you are really stuck, you could search the HTML for all the UI Pages to return anything that contains "survey".


View solution in original post

8 REPLIES 8

TrevorK
Kilo Sage

Are you using the legacy surveys or assessments?



We are using assessments. The code for the Survey page is stored in a UI Page titled "survey". I assume regardless of what you use (legacy surveys or assessments), the "xxxxxx.do" page will tell you which UI Page you are using.



Within this page, in the HTML section, is all of the code. The save button is towards the bottom.




Where I am unsure is whether there is a way to do this with ACLs so you do not have to modify the UI Page itself. However, it may not be a big deal to modify the UI Page (we have) because it is very basic and you might want to do some more advanced things with the survey's. I know with forms you can do it with ACLs because it evaluates whether to display based on the conditions, but with a UI Page I do not see any conditions for loading the button so I assume you have to remove it this way. There could very well be better solutions, however this one should definitely work.




If you are using the legacy survey functionality and cannot figure out the UI Page it is stored on (it is my assumption it is stored in a UI Page for them too), then I can always load it in my developer instance and let you know what I can find.


brocoppler
ServiceNow Employee
ServiceNow Employee

Unfortunately, I do not see a UI Page titled 'survey'. Anything else it could be?


It will depend on what version of survey you use. If you look around your "Survey Instance" page, you will stumble across something to the effect of "Take Survey" or "View Public URL".



There are quite a few places. I just double checked ours, and "survey.do" was a copy we made for a custom one. My apologies, your instance would not have that one!




The one that comes OOB with Assessments is "assessment_take2.do" and for Legacy Surveys is "survey_take.do" (I just double checked). If you are really stuck, you could search the HTML for all the UI Pages to return anything that contains "survey".


EthanVanDoorne
Giga Contributor

The two lines I removed to accomplish:



<!-- <button class="btn btn-default" type="submit" onClick="return saveAssessment();" id="save" name="save">${gs.getMessage('Save')}


  </button> -->



<j:if test="${isUserLoggedIn}">


  <button class="btn btn-default" type="submit" onClick="return saveAssessment();" id="save" name="save">${gs.getMessage('Save')}


  </button>


  </j:if> -->



Somewhere around line 450 in the HTML for assessment_take2.do