Answered by:
Sharepoint ticket tracking EXIT Sharepoint on save

Question
-
I have the basic Sharepoint ticket tracking system put together and ready to use.
The only problem is that when the user clicks "Save" it opens the list of all the tickets.
I need it to just exit out of Sharepoint when they click "Save".
Thank you in advance for any help.
Gee
Gee
Answers
-
You can redirect the page to another page after submitting / saving. Below code for your reference:
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('input[value=Save]').click(function() { window.location.replace("http://<site>/<destination>");}); }); </script>
https://www.sharepointdiary.com/2011/05/redirect-to-another-page-after-new-item-submit.html
sharath aluri
- Proposed as answer by Itch SunMicrosoft contingent staff Friday, November 8, 2019 2:07 AM
- Marked as answer by GretaF Monday, November 18, 2019 7:45 PM
All replies
-
You can redirect the page to another page after submitting / saving. Below code for your reference:
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('input[value=Save]').click(function() { window.location.replace("http://<site>/<destination>");}); }); </script>
https://www.sharepointdiary.com/2011/05/redirect-to-another-page-after-new-item-submit.html
sharath aluri
- Proposed as answer by Itch SunMicrosoft contingent staff Friday, November 8, 2019 2:07 AM
- Marked as answer by GretaF Monday, November 18, 2019 7:45 PM
-
-
Hi GretaF,
OOTB method can't complete your needs.
According to my research, there is no better or simpler way to meet your needs so far.
The advice from Sharath seems to be the most appropriate option.
Best regards
Itch Sun
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
SharePoint Server 2019 has been released, you can click here to download it.
Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019. -
Hi
I am checking your situation here.
Any progress on your troubleshooting?
If you think the replies are helpful to you, please remember to mark them as answers. It will help others who meet the similar question in this forum.
Best regards
Itch Sun
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
SharePoint Server 2019 has been released, you can click here to download it.
Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.- Edited by Itch SunMicrosoft contingent staff Monday, November 11, 2019 8:24 AM
-
Hello,
I did get it to redirect to a SharePoint site where the link will be located in the future, but it doesn't ALWAYS work.
Sometimes, when I fill in the info on the form and click "Save" it sends me to the URL I've set and redirect, but not always.
Sometimes, when I fill in the info on the form and click "Save" it sends me to the List the form is associated with.
The script is below.
blah1 is my company, blah2 is the particular team.
BTW: Clicking "Cancel" sends to that site every time, no problem. It's "Save that's not working.
$(document).ready(function() {
$('input[value=Save]').click(function() {
window.location.replace("https://blah1.sharepoint.com/teams/blah2/sitepages/index.aspx");
});
$('input[value=Cancel]').click(function() {
window.location.replace("https://blah1.sharepoint.com/teams/blah2/sitepages/index.aspx");
});
});
</script>
<script type="text/javascript" src="/test/English/Javascript/sessvars.js"></script>
<script type="text/javascript">
function PreSaveAction(){
sessvars.targetUrl = ‘<script src="/SiteAssets/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input[value=Submit]').click(function() {
window.location.replace("https://blah1.sharepoint.com/teams/blah2/sitepages/index.aspx");
});
$('input[value=Cancel]').click(function() {
window.location.replace("https://blah1.sharepoint.com/teams/blah2/sitepages/index.aspx");
});
});
</script>
<script type="text/javascript" src="/test/English/Javascript/sessvars.js"></script>
<script type="text/javascript">
function SaveAction(){
sessvars.targetUrl = "https://blah1.sharepoint.com/teams/blah2/sitepages/index.aspx";
return true;
}
</script>
Gee
-
Hi Gee,
You can use fiddler to see if a error occurred when the page was redirected.
Best regards
Itch Sun
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
SharePoint Server 2019 has been released, you can click here to download it.
Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.