I’ve seen quite a few posts around on various forums about redirecting users to a different page after filling out a form. I thought I’d recap some options. These may or may not be applicable to all SharePoint forms so review your options.
On your SharePoint site, be it a link added to the Quick Launch, stored in a links list, or created in a Content Editor web part, append a ?Source=
query string parameter to the end of the new form URL. So something like this:
http://myspsite.com/sites/mysite/Lists/Announcements/NewForm.aspx?Source=http://www.yahoo.com.
This will redirect the user to Yahoo after completing the form. This could be any place, back to the default.aspx page or to a custom ThankYou page.
I had asked a question on how to do this with jQuery on the old Stump the Panel forums on nothingbutsharepoint.com. Matt Bramer was able to come up with a solution utilizing jQuery. This appends a source query string parameter to the URL for a hrefs that contain NewForm.aspx and returns them to the originating page.
$(document).ready(function() {
$("a[href*='NewForm.aspx']").click(function(){
var curr_URL = document.location.href;
appendTo_URL = "?Source=" + curr_URL;
var link_URL = $(this).attr('href');
//alert(link_URL + appendTo_URL);
$(this).attr('href', link_URL + appendTo_URL);
});
});
In SharePoint Designer, you can copy the list’s NewForm.aspx page and create your own custom NewForm by closing the default web part and adding in a Custom ListForm. I’ve used this Sharepoint Kings article many times in situations where I’m heavily customizing a form and want to control the redirection.
Alexander Bautz has an interesting method here.