I'm trying to redirect users to a custom URL after hitting the finish button. I can get the page to redirect but the survey isn't marked as completed and no data is saved.

I'm using this below:

<script type="text/javascript" language="javascript">
   function PreSaveAction() {
       var srcUrl=GetSource();
       var newSrcUrl = "http:///sites/surveys/Lists/Test/ThankYou.aspx";
       var i = aspnetForm.action.lastIndexOf(srcUrl);
       aspnetForm.action = aspnetForm.action.substring(0,i) + newSrcUrl ;
       return true;

Any ideas how to redirect and have the survey marked as complete?

3 Answers 3


I think there are various ways to do this, below are some of the ways you can try:

1) Customizing your NewForm.aspx and Insert SharePoint Form Action button from "Insert Menu >> SharePoint >> Form Action Button"

Select the Form Actions "Commit" and "Navigate to Page" and click "OK"


2) Using Jquery to change url of new form. The objective is to create a URL that follows this pattern: http://[server]/[list]/NewForm.aspx?Source=[ThankYouPage.aspx].


  • Thanks. 1)But i can't customize my newform.aspx as my survey is a long one with branching and separator. 2)The second option for me too is a bit trick since my finish button is on the editform.aspx not newform.aspx. So don't think any of those 2 optins would help. I have got it to the point where all i need is to make sure the survey is marked as completed. Right now i can redirect but data isn't saved. :(
    – naijacoder
    Dec 17, 2013 at 5:03
  • 2
    can you try making url of edit form something similar to this: http://[server]/[list]/EditForm.aspx?ID=[id of survey number]&Source=[ThankYouPage.aspx]
    – Amit
    Dec 17, 2013 at 5:44
  • try this: You can change the default view (the default is overview.aspx) for the Survey list in SharePoint Designer: * Right click on the list * Choose properties * Go to the Supporting Files tab * Change the default view page source
    – Amit
    Dec 17, 2013 at 5:54
  • Thanks Amit. Can't see these options in SharePoint 2010.Any ideas
    – naijacoder
    Dec 17, 2013 at 22:33

Hi If anybody still faces same situation It will not work if you redirect in Presaveaction. Even if page redirects the survey will not be completed. Only way is to redirect immediately on page load after the survey completes (i.e. From Overview or AllResponses view using script editor)

  • Nice solution, I have created Thankyou.aspx view from designer and make it default, then added script editor in it with success message and redirection and it is working fine as per the expectation. the only limitation is that to get the report you have to remember the overview.aspx, allitems.aspx views url otherwise it will always goes to thankyou.aspx page when you open the survey list. Jun 9, 2019 at 5:09

Have you tried SPServices SPRedirectWithID to do the redirection for you? I'm not sure if it will work with a survey but it is worth a shot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.