Third button to save and return in edit mode

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
TWendt
Posts: 109
Joined: Mon Sep 08, 2014

15 Feb 2017

Hi,

i use this javascript to close the form.
fd.cancel().click(function(){ STSNavigate('/itdepartment/pcr/SitePages/My%20Process%20Change%20Requests.aspx');return false; });
fd.onsubmit(function (){
$("#aspnetForm").attr('action',location.pathname+'?Source=/itdepartment/pcr/SitePages/My%20Process%20Change%20Requests.aspx');
return true;
});

But i need a third button for savings the results and open the form in edit mode again. If i add the button and use the OnClick function
fd.sourceFormParam(decodeURIComponent(window.location.href));
return true;
the form is closed. Please help.
Best wishes
Tom

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

16 Feb 2017

Hi Tom,

Remove this part of your code from JS-editor:

fd.onsubmit(function (){
$("#aspnetForm").attr('action',location.pathname+'?Source=/itdepartment/pcr/SitePages/My%20Process%20Change%20Requests.aspx');
return true;
});
And put this into OnClick property of the first Save button:

fd.sourceFormParam('/itdepartment/pcr/SitePages/My%20Process%20Change%20Requests.aspx');

TWendt
Posts: 109
Joined: Mon Sep 08, 2014

16 Feb 2017

Hi Dmitry,

done but i now i became an error if i press the normal save button. He pointed to a wrong URL.

Correct URL: /itdepartment/pcr/SitePages/My%20Process%20Change%20Requests.aspx

Wrong URL: /itdepartment/pcr/SitePages/My%2520Process%2520Change%2520Requests.aspx

Any ideas?

Best wishes

Tom

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

17 Feb 2017

Hi Tom,

Try this:

fd.sourceFormParam('/itdepartment/pcr/SitePages/My Process Change Requests.aspx');

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests