SharePoint Survey: Forward user to a Thank You Page, but return to previous page when cancelling the survey - Fabian Neve

About SharePoint, Javascript, PowerShell, and other technical stuff

Friday, April 7, 2017

SharePoint Survey: Forward user to a Thank You Page, but return to previous page when cancelling the survey

A blog title almost longer than the script itself.



First of all, get Jquery and place it in your SiteAssets Library.

Open NewForm.aspx of your Survey (via "Respond to this survey") and edit the page (top right corner, Edit Page). Insert a script editor web part at the bottom of the form with following code:


Then Stop Editing the page, return to the survey and open NewForm.aspx again by clicking on Respond to this survey. Check the URL (copy and paste it into notepad) and you'll see the Source= Input. There you can put the link to your Thank-You-Page (Replace "/" with %2F and "." with %2E etc.) Place the new URL into a Hyperlink or in your navigation.

The Result

If you did it right ;-) completing the survey will send the user to the Thank You.aspx page, where cancelling the survey will send you back to the previous page.