SharePoint users are always redirected to the default list view (AllItems.aspx) after creating a new List Item or submitting a custom form (Save, Cancel, Close - they all do that).
- Create List Item (NewForm.aspx) - Clicking Save or Cancel button redirect to default list view.
- Edit List Item (EditForm.aspx) - Clicking Save or Cancel button redirect to default list view.
- Access List Item (DispForm.aspx) - Clicking Close button redirect to default list view.
But what if you want to redirect the user to the "Home page", custom "Thank you" page or any other page.
Well, there is a simple OOTB (out of the box) solution to achieve this.
This quick solution works for SharePoint Online / SharePoint 2019 / SharePoint 2016 / SharePoint 2013 / SharePoint 2010 / MOSS. Test it in your development environment before implementing for live site.
⭐ Steps to redirect to different page after adding new list items in SharePoint
- Navigate to your SharePoint List / Library.
- Click "New" button from Ribbon to create a new List Item.
- Copy the URL link from address bar in browser.
- Replace the redirection link, everything after "Source=". You may ignore the RootFolder parameter.
- Assume, we have a custom Thank you page created at this location - https://c2c.sharepoint.com/sites/SPDev/SitePages/Thankyou.aspx.
Append this link after "Source=" as below. - Now you can use this link and add it in navigation (Quick Launch, Top Navigation, Quick Links, etc.).
- When user saves a new item using this link, will be redirected to custom thank you page.
It will be in this format -
https://c2c.sharepoint.com/sites/SPDev/Lists/Projects/NewForm.aspx?Source=https://c2c.sharepoint.com/sites/SPDev/Lists/Projects/AllItems.aspx&RootFolder=
The "Source" parameter tells SharePoint where to redirect the user after form submission.https://c2c.sharepoint.com/sites/SPDev/Lists/Projects/NewForm.aspx?Source=https://c2c.sharepoint.com/sites/SPDev/SitePages/Thankyou.aspx
For redirecting to the Home page, simply add sign "/" for Source parameter.
http://sharepointsite/Lists/SPList/NewForm.aspx?Source=/
http://sharepointsite/Lists/SPList/EditForm.aspx?id=1&Source=/
http://sharepointsite/Lists/SPList/DispForm.aspx?id=1&Source=/
You can use this approach for both Modern and Classic SharePoint development - with SPFX custom forms, HTML and JQuery based forms in Content Editor / Script Editor web parts.
Have Questions? Post them here!
More Posts related to SharePoint,
- SharePoint error - An exception occurred when trying to issue security token: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms..
- PowerShell iterate and get all SharePoint sites and sub sites
- SharePoint Online: Editing session has ended Message
- How to Share Microsoft SharePoint Site with Users or Groups
- How to delete SharePoint Online List Item using REST API
- SharePoint List excel import - This table exceeds the maximum number of supported rows
- How to disable SharePoint subsite creation option for owners
- SharePoint 2010 August 2015 Update KB3055049 - Duplicate Document ID issue bug fixed
- SharePoint Server 2016 Preview installation error - This Product Key isn't a valid Microsoft Office 2016 Product Key. Check that you've entered it correctly.
- How to upload file programmatically to SharePoint Document Library using Server Object Model C# .Net
- Access URL for SharePoint Tenant Admin Center (Online Office 365)
- Error when deleting SharePoint Online folder or file
- How to extend retiring SharePoint 2010 Workflows and continue with Office 365
- How to generate client id and secret to register SharePoint App with OAuth
- How to delete SharePoint List Item programmatically using C#.Net
- How to retrieve all SharePoint Online List Items using Rest API
- [Solved] SharePoint Search Internal server error exception
- Create SharePoint Site Collection using PowerShell New-SPSite
- Fix SharePoint PowerShell error - The term Get-SPweb is not recognized as the name of a cmdlet function script file or operable program
- How to enable anonymous public access for SharePoint Online site collection, file, folder without login ?
- SharePoint Server 2016 installation System Hardware requirements
- How to create SharePoint Online List Item using REST API
- Changed AD user display name showing old name in SharePoint
- Recommended size and resolution for SharePoint Online Site logo
- Microsoft 365: How to Turn Off Delve in SharePoint Online for All Users
More Posts:
- 11 Weeks of Android Online Sessions-15-Jun-to-28-Aug-2020 - Android
- [Fix] java: incompatible types: java.lang.String cannot be converted to int - Java
- How to clear Cache, Cookies and History on iPhone Safari - iOS
- Fix: SpringFramework BeanDefinitionValidationException: Could not find an init method named - Java
- Split String in Python with Multiple Delimiters - Python
- How to Uninstall Microsoft Teams on Mac - Teams
- Java SE JDBC Select Statement Example - Java
- PHP Fatal error : Call to a member function bind_param() on a non-object - PHP