Prevent "Leave Site? Changes you made may not be saved." popup while submitting the Catalog form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2018 04:04 AM
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.
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
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2018 05:45 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2018 08:00 AM
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"); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2019 08:34 AM
Hi Venu - did you find any solution for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2019 09:53 AM
Yes.
g_form.modified = false;
This did the trick.