fd.onsubmit with confirm


Posted by Dan_C - Oct 6 ’16 at 05:03

I'm getting the confirmation popping up twice with the code below --  any ideas for a workaround?


fd.onsubmit(function() {


if (fd.field('PROJECT_ApprovalWF_Comments').value() == '') {

alert('Please add a comment when rejecting.');

return false;

} else if (confirm("To reject this PROJECT and immediately end the approval process without requesting any changes click OK, otherwise click Cancel and choose the Send back option to request changes and restart approval.")) {






return true;} else {return false;}



  • YuriyMedvedev
    Member for: 5 years 7 months 25 days
    #1 by YuriyMedvedev Oct 7 ’16 at 03:42


    Check, please, if you defined "onsubmit"-function on Submit-button(or any buttons)  and in "Javascript" too. Or just added handler in "Javascript" twice.

  • Dan_C
    Member for: 7 years 5 months 25 days
    #2 by Dan_C Oct 7 ’16 at 07:36

    I am calling the fd.onsubmit function inside onclick of different save buttons for each kind of response (approve, reject, send back) with different updates in each.


    Should I do it a different way?

  • Dmitry Kozlov
    Dmitry Kozlov
    Member for: 8 years 8 months
    #3 by Dmitry Kozlov Oct 7 ’16 at 09:07

    [#2]: We've just supposed that you added the same handler twice and as a result you're gettings the confirmation twice.

Displaying 1 to 3 of 3 messages