SharePoint List redirect user after submitting form NewForm.aspx


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.

Redirect to different page after adding new SharePoint list
Redirect to different page after adding new SharePoint list

⭐ Steps to redirect to different page after adding new list items in SharePoint

  1. Navigate to your SharePoint List / Library.
  2. Click "New" button from Ribbon to create a new List Item.
  3. Copy the URL link from address bar in browser.

  4. 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.

  5. Replace the redirection link, everything after "Source=". You may ignore the RootFolder parameter.

  6. 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.
  7. https://c2c.sharepoint.com/sites/SPDev/Lists/Projects/NewForm.aspx?Source=https://c2c.sharepoint.com/sites/SPDev/SitePages/Thankyou.aspx

  8. Now you can use this link and add it in navigation (Quick Launch, Top Navigation, Quick Links, etc.).
  9. When user saves a new item using this link, will be redirected to custom thank you page.

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!





Recent Posts:
Hello there!,

You are using AdBlocker!

I am an independent developer trying to help fellow developers and students to resolve issues faced on a day-to-day basis, we 'Code to Care' . There is a lot of expenses involved in hosting and managing a website that's the reason we have ads.

A humble request to you to disable adBlocker on Code2care.org and support us pay our bills.

Thanks,
Cod2ecare - Line's of code for change.

To see contents reload page after unblocking
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.