Page 1 of 1

Third button to save and return in edit mode

Posted: 15 Feb 2017
by TWendt
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

Re: Third button to save and return in edit mode

Posted: 16 Feb 2017
by Dmitry Kozlov
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');

Re: Third button to save and return in edit mode

Posted: 16 Feb 2017
by TWendt
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

Re: Third button to save and return in edit mode

Posted: 17 Feb 2017
by Dmitry Kozlov
Hi Tom,

Try this:

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