- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2020 08:46 PM
Hi,
I cloned form widget and keeps getting this leave site alert when I'm trying to click on save button of the form.
Any suggestions to get rid of this alert?
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2020 08:39 AM
Hi,
on form we can get to know which fields got changed. but that is difficult on portal
can you try this just before navigation
window.onbeforeunload = function () {
// blank function do nothing
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2020 10:02 AM
Thanks Ankur. Based on the selections, we do hide lot of fields. Is there a way to identify which fields have changed after load?
We do use the same form on platform and didn't see any issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2020 08:39 AM
Hi,
on form we can get to know which fields got changed. but that is difficult on portal
can you try this just before navigation
window.onbeforeunload = function () {
// blank function do nothing
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2020 08:24 PM
Ankur, that didn't worked but I think it might be 'Seconds part of Duration field type which I'm hiding on the UI.
#dur-seconds-u_start_date_of_activity {
display: none;
}
I don't see this alert when I used OOTB Form Widget. How can I fix this?
<input type="text" class="form-control ng-valid ng-not-empty ng-dirty ng-valid-parse ng-touched"
id="dur-hours-u_start_date_of_activity" ng-model="parts[unit]" ng-disabled="field.isReadonly()"
ngchange="updateDuration()" title="Hours" role="textbox" aria-invalid="false" style="">
<input type="text" class="form-control ng-valid ng-not-empty ng-dirty ng-valid-parse ng-touched"
id="dur-minutes-u_start_date_of_activity" ng-model="parts[unit]" ng-disabled="field.isReadonly()"
ng-change="updateDuration()" title="Minutes" role="textbox" aria-invalid="false" style="">
<input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty"
id="dur-seconds-u_start_date_of_activity" ng-model="parts[unit]" ng-disabled="field.isReadonly()"
ng-change="updateDuration()" title="Seconds" role="textbox" aria-invalid="false">
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2020 11:37 AM
Hi Ankur,
Any other suggestions to fix this alert?
Thanks,
Ashraf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2020 02:08 PM
Thanks, I was able to remove alert after following your suggestion window.onbeforeunload.