Third button to save and return in edit mode

rss

Posted by TWendt - Feb 15 ’17 at 07:09

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

 

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 9 months 26 days
    #1 by Dmitry Kozlov Feb 16 ’17 at 03:37

    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');
  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 9 months 26 days
    #2 by Dmitry Kozlov Feb 16 ’17 at 03:37

    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
    Member
    Member for: 4 years 10 months 8 days
    #3 by TWendt Feb 16 ’17 at 06:00

    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

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 9 months 26 days
    #4 by Dmitry Kozlov Feb 17 ’17 at 02:51

    [#3]: Hi Tom,

    Try this:

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

Displaying 1 to 4 of 4 messages