URL Source= for Thank You on Submit
Guest Author: Jeff Jones, SharePoint on a String
Jeff Jones is a SharePoint developer and administrator in Chicago, IL. He enjoys whiteboarding, peer coding, and being creative with software. He has over 6 years of SharePoint experience and holds MCSE and MCTS certifications.
From Jeff Jones: Many times I’ve been asked to adjust the NewForm.aspx (add record) experience for users to display a custom message after submit. A “Thank You” page for a survey is a great example. Other times in request forms people want to show a confirmation or instructions page.
Thankfully the SharePoint product team made this easy for us developers.
Action Steps
- Visit the list or library you’d like to tweak
- Click on New item to get to /NewForm.aspx
- Take a close look at the URL and notice the word “Source=”
- We’ll come back to this in a minute
- To create a “ThankYou.aspx” page I like to duplicate the “DispForm.aspx” by going into SharePoint Designer
- Right click Copy on DispForm.aspx
- Right click and Paste
- Edit the file to remove the main web part
- Rename the file to “ThankYou.aspx”
- Edit the part after the equals sign (=) from #3 and replace with a URL you’d like to take people to after submit
Often the destination page for #5 above doesn’t yet exist. So you’ll want to open SharePoint Designer 2007 and create a new ASPX page to hold a “Thank You” message. For this I always place the ASPX file in the same /Forms/ folder as the list I’m working on.
Why? By placing a custom ASPX in the same /Forms/ folder it will be including in any List template (.STP) creation and is easier for future admin and dev staff to locate for troubleshooting.












Hi Jeff,
Interesting article.. but how to we get to change the destination URL? so that everyone can get to the same destination URL. I mean.. if you respond to the survey..it still points to Overview.aspx instead Thankyou.aspx… do you think we can solve it using SPD?
Thanks
Vamshi
If you are creating a custom new list form in SPD (Insert > SharePoint controls > Custom List Form), you can right-click on the OK button and choose Properties and change the RedirectURL value in the Tag Properties pane.
Or, if you don’t want to use the default buttons, you can insert a form action button from the Toolbox. A form actions box will automatically pop-up with an option for “Navigate to page”.
Hi Vamshi,
Very good question. I’m a big JavaScript fan and a little biased that way when I think about solutions.
How about adding JavaScript on the NewForm.aspx page to “fix” the URL if pointed at Overview.aspx?
Modifying the system button for “Respond to this Survey” I’m not sure how to do and doubt is supported.
The quick way would be like:
if (document.location.href.indexOf(”overview.aspx”)>0) {
document.location.href=”";
}
Hi Caleb and Jeff,
Thanks for the response
Both of the options are great. The disadvantage we have by creating custom list forms is we loose the ability to attach files and Form Action works really well to navigate to a different page.
Both Javascript and Form actions buttions are really cool. But now I am thinking.. how to we utilise this URL “Source=” functionality??? any ideas..?
Thanks
Vamshi,
You’re right, you do lose the ability to attach files, which is a bug that MS apparently has no plans to fix. Definitely something to consider.
If there’s any consolation, the file attachment is still available in the editform.
I followed the steps dutifuly, only to discover that the solution breaks when branching is used within the survey. Has anyone else encountered this and found a path to resolution?
Does this require MOSS or can it also be done in WSS? I am having difficulty with the redirect URL.
Hi Brad,
Yes, this can be done directly with WSS. It also works on any list template. Calendar, Task, Documents, etc.
Best,
Jeff
I know this blog is a bit old now, but is it possible to set this so that the default for all users is to go the Thanks.aspx page.
From your instructions above, it looks like it’s a one time only redirect.
My survey has branching enabled, and is open to all authenticated users. I want them to be directed to the thank you page when they’ve completed, rather than the summary or overview page.
Thanks
Hi Mark,
The redirect is part of the original request URL. So it all depends on how people get into the “NewForm.aspx” page. Typically I see HTTP links manually entered into an email where it easy to add the “?Source=ThankYou.aspx” suffix.
JavaScript could help by adding the “?Source” URL parametric if missing. Adding a Content Editor Web Part to host JS code on the ASPX page guarantees no matter how people visit the page it can add the URL paramter (if missing).
Check out insertParam() at http://stackoverflow.com/questions/486896/adding-a-parameter-to-the-url-with-javascript
Best,
@spjeff
Hi Jeff!
Thanks for your knowledge, i have a question though.
There are 2 options if im correct:
the ?source (redirect) and the ?IsDlg (show in full screen) option.
If i use them seperately, everything works fine. But if i use them in combination only one works.
Do you have any experience with this ?
Thanks a bunch!
Roland de Goeij.
Hi Roland,
I have not worked with that URL parameter before, but will take a look. Thanks for the heads up. I wrote this article for SharePoint 2007 and “IsDlg” appears to be something new for 2010.
I would try to keep it as simple as possible and probably just use the ?Source= by itself.
I’ve found a low-tech solution to the Thank-You page thingy. They don’t have SharePoint Designer on my machine so I had to go low tech.
I create one page after my last question that has the following attributes:
Question: You’re Done!
Type: Choice
Require Response: No
Choices: Thank You<==This is the only choice!
Display Choices Using: Either Radio Button or Drop-Down
Allow Fill-in: No
Default: Thank You
Like I said, it is low tech, but it works. This way, if you have branching questions, you can direct your survey takers somewhere when they are done.
Another…possibly more palatable solution is to use the ‘Single Line of Text’ or ‘Multiple Lines of Text’ options and allow your survey takers to leave additional information in addition to their responses, but in text form.
You’d set it up like this:
Question: “You’re Done!” a couple of lines down type “Would you like to share something with us?” or something like that.Type: Single Line of Text or Multiple lines of Text
Require Response: No
Number of lines: I usually leave the default of 6
Specify Text to allow: Plain Text
This way your survey taker has the added ability to clarify thier survey answers…if you really want to give them that opportunity.
:-)