I want to cancel confirm window after clicking cancel button

Jasmit Kaur
Kilo Contributor

Hi,

If user press cancel - It will ask confirmation, if press OK - cancel change- if cancel It must return to change form without cancelling the record.

If you have any solution then give it to me.

1 ACCEPTED SOLUTION

Pooja Devkar
Mega Guru

Hello,

Use below code:

Note : check the 'client' checkbox and in 'onlick' field , paste this cancelTicket();

function cancelTicket(){

      var answer=confirm("Are you sure you want to cancel this record?");

      if (answer==true)

              {

              gsftSubmit(null, g_form.getFormElement(), 'cancel_change');

      }

    else {

              return false;

      }

if(typeof window == 'undefined'){

      current.state = 8;

      current.update();

      action.setRedirectURL(current);

      gs.addInfoMessage('The current change request has been cancelled.');

}

Please mark correct & helpful; if it's useful to you.

Thanks & Regards,

Pooja Devkar

View solution in original post

2 REPLIES 2

Pooja Devkar
Mega Guru

Hello,

Use below code:

Note : check the 'client' checkbox and in 'onlick' field , paste this cancelTicket();

function cancelTicket(){

      var answer=confirm("Are you sure you want to cancel this record?");

      if (answer==true)

              {

              gsftSubmit(null, g_form.getFormElement(), 'cancel_change');

      }

    else {

              return false;

      }

if(typeof window == 'undefined'){

      current.state = 8;

      current.update();

      action.setRedirectURL(current);

      gs.addInfoMessage('The current change request has been cancelled.');

}

Please mark correct & helpful; if it's useful to you.

Thanks & Regards,

Pooja Devkar