Answered by:
Redirect to homepage after successful add item in custom list

Question
-
Hello,
I want to set redirect page (homepage) once user successful submit newform.aspx form. Is there any solution?
Thank You
Wednesday, December 28, 2016 11:31 AM
Answers
-
Hi,
You can add the following code in NewForm page to achieve your requirement.
<script type="text/javascript"> function PreSaveAction() { window.open("/SitePages/Home.aspx","_blank"); return true; } </script>
If your home page URL is not <site collection URL>/SitePages/Home.aspx, you can modify code to insert your correct Home page.
How to add code in page using Content Editor Web Part:
Thanks,
Dean Wang
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com
Thursday, December 29, 2016 8:35 AM
All replies
-
Hi
create your custom newform.aspx file for your list ( using Sharepoint Designer for example ) . Set it as a default form.
Customize the submit button and add needed
Check this similar doc as well
https://adrianhenke.wordpress.com/2010/08/19/custom-redirect-after-creating-a-new-sharepoint-item/
Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.
Wednesday, December 28, 2016 2:17 PM -
Hello,
Im using default newpost.aspx (blog) . If i create custom newpost.aspx, the link from list post to details post is incorrect.
Thank You.
Thursday, December 29, 2016 3:02 AM -
Hi,
You can add the following code in NewForm page to achieve your requirement.
<script type="text/javascript"> function PreSaveAction() { window.open("/SitePages/Home.aspx","_blank"); return true; } </script>
If your home page URL is not <site collection URL>/SitePages/Home.aspx, you can modify code to insert your correct Home page.
How to add code in page using Content Editor Web Part:
Thanks,
Dean Wang
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com
Thursday, December 29, 2016 8:35 AM -
Hello,
Thank You and its worked. How about if i want to set redirect link based on selected item dropdown?
Thank You.
Friday, January 6, 2017 11:52 AM