Reload form if the user clicks on Cancel button on the confirmation box

shravan3
Kilo Expert

Hi,

Please let me know how can reload the form if the user clicks on the cancel button on the confirmation box ?

I have written below code but it is not working as expected. Below code is reloading the form but it is saving the changes which was entered .

function onSubmit() {

if ((g_form.getValue('state') == 17) )){

var answer = confirm('Do you want to really Reject & Close the change?');

if(answer == false){

location.reload(true);

}

}

}

Thanks & Regards,,

Shravan Kumar

1 ACCEPTED SOLUTION

HI shravan,



Plesae do following changes in the code


function onSubmit() {



if ((g_form.getValue('state') == 17) ))


{


var answer = confirm('Do you want to really Reject & Close the change?');


if(answer == false)


{


window.top.location.reload(true);


return false;


}


}


}


View solution in original post

9 REPLIES 9

shravan3
Kilo Expert

Thanks Shubh & Shishir,



I have tried the below



window.top.location.reload(true) - It is reloading the form but it is saving the entered changes.


window.location.reload(); - It is also reloading the form and saving the record with entered changes



User changes should not saved after reloading the form. Please let me know how can achieve this


HI shravan,



Plesae do following changes in the code


function onSubmit() {



if ((g_form.getValue('state') == 17) ))


{


var answer = confirm('Do you want to really Reject & Close the change?');


if(answer == false)


{


window.top.location.reload(true);


return false;


}


}


}


PLZ mark this correct if it resolved your issue or feel free to ask if u still have any queries.


Thanks Shubh,



It is worked for me .. ☺



Making your answer as correct



Regards,


Shravan Kumar


Hi Shravan,



My pleasure....:)



Regards,


Shubh