Page 1 of 1
Two Save Buttons
Posted: 31 Aug 2017
by jennifer.eckard
I have my form redirecting to the front page this is ideal for the majority of users however for the IT folks I would like a separate Cancel and Save button that returns to the list that shows on the Support tab, but I am not sure how to do this.
Re: Two Save Buttons
Posted: 31 Aug 2017
by Nikita Kurguzov
Hello, Jennifer!
Here you can read about designing different forms for different user groups in SP Online -
https://spform.com/groups-and-form-sets ... int-online
Once you add second Form set for IT specialists, add this code to JavaScript editor in Forms Designer:
Code: Select all
fd.cancel().click(function(){
STSNavigate('/sites/yoursite/Lists/YourList/AllItems.aspx');
return false;
});
fd.onsubmit(function() {
STSNavigate('/sites/yoursite/Lists/YourList/AllItems.aspx');
return true;
});
Re: Two Save Buttons
Posted: 31 Aug 2017
by jennifer.eckard
I attempt to follow those directions and when I load the script the page starts to jump and I can not even save the changes.
Re: Two Save Buttons
Posted: 31 Aug 2017
by Nikita Kurguzov
Are you using SharePoint Online or SharePoint 2013/16? This article is primarily for SP Online users.
First, design the Forms for different groups and make them work. You can add Plain/Rich Text control with the name of the Form, so you can see difference between them when you open them in the browser. Once both forms are complete and work, add these blocks one by one to the IT group Form and test it after adding each part:
Code: Select all
fd.onsubmit(function() {
STSNavigate('/sites/yoursite/Lists/YourList/AllItems.aspx');
return true;
});
Code: Select all
fd.cancel().click(function(){
STSNavigate('/sites/yoursite/Lists/YourList/AllItems.aspx');
return false;
});
If you still experience trouble - let us know! Plus screenshots of the browser's console or some other visual representations of the errors might be very useful. Maybe tell us after what steps exactly did the errors appear, etc. We'll simply need more information to help.
Re: Two Save Buttons
Posted: 31 Aug 2017
by jennifer.eckard
I am using O365 and I was using the second redirect option I was just trying to add the redirect script and when I do that the page continues redirect and redirect
Re: Two Save Buttons
Posted: 31 Aug 2017
by Nikita Kurguzov
Can you post here the code you were adding for redirection?