- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 06:00 AM
I have an onSubmit Client Script which validates fields on a form and displays messages if certain criteria isn't satisfied.
However I have found that this script will trigger when trying to view the history list of the record. No changes or updates are being made to the record.
This is negatively impacting our users and there shouldn't be any cause for this script to fire.
Any suggestions on how to resolve this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 06:27 AM
In your client script, you can check if g_form has been modified, so that it won't trigger unless a field value was changed.
For example, inside of your onsubmit function, you would add a line like this at the top to skip the script if no fields were modified.
if(!g_form.modified){
return true;
}
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 06:18 AM
I was able to verify this when I Right click -> History -> List
Seems like a platform bug.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 06:27 AM
In your client script, you can check if g_form has been modified, so that it won't trigger unless a field value was changed.
For example, inside of your onsubmit function, you would add a line like this at the top to skip the script if no fields were modified.
if(!g_form.modified){
return true;
}
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 07:44 AM
Hi @Michael Jones -, this did the trick perfectly! Quick easy solution. Appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 07:04 AM
Hello @MBarrott ,
You can "g_form.modified" in you script. It will true or false value. If the form fields are changed it will return and false if not. that way you can display messages based on this value.