Prevent "Leave Site? Changes you made may not be saved." popup while submitting the Catalog form

vallamreddyvenu
Giga Contributor

Hi there,

We have recently moved to kingston. We have catalog form that submits data to a table. We are submitting the data to a table and then redirecting the user using "window.location.href". Before we upgrade to kingston, it was submitting the data to table and redirecting the user to the URL. But now after upgrade, when we click on submit button, the below popup is being displayed.

find_real_file.png 

The above popup is from IE. In chrome, a popoup with the text ""Leave Site? Changes you made may not be saved.".  Until, we click on "Leave this page", the redirection is not happening. But the form data has already been saved to table. If i can bypass the above popup, i can redirect the user just by click on submit button. Can somebody please help us on how to bypass these popups and redirect the user to the URL specified. 

Thanks,

Venu

6 REPLIES 6

Allen Andreas
Administrator
Administrator

Hi,

Can you post your code here where you have the window.location.href redirect going on?


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Allen,

 

Below is my code.

 

 

var spr = new GlideAjax('SCRefQualifier'); spr.addParam('sysparm_name','saveParentRequest'); 
spr.addParam('sysparm_RequestedFor', u_RequestedFor); spr.addParam('sysparm_RequestedDate', u_RequestedDate); 
spr.addParam('sysparm_Comments', u_Comments); 
spr.addParam('sysparm_Description', requestDescription); 
spr.addParam('sysparm_Company', u_Company); 
spr.addParam('sysparm_Environment', u_Environment); 
spr.addParam('sysparm_Urgency', u_Urgency); 
spr.getXMLWait(); 
var srrequestnumber = spr.getAnswer(); 
if(srrequestnumber ) 
{ alert("Thank you for submitting your request , a release coordinator will contact you shortly to coordinate your request. A request with the number " + srnumber + " has been submitted successfully"); 
window.location.href = "home.do"; } 
else 
{ 
alert("There is problem while submitting the request. Please contact the administrator"); }

 

Paul125
Kilo Guru

Hi Venu - did you find any solution for this?

Yes.

 

g_form.modified = false;

 

This did the trick.