Field message disappearing when clicking on form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 05:11 AM
I've created the following client script to show a field message on a form:
When the form loads, it appears:
However, if I click on any part of the form, it disappears:
I was just wondering if someone could explain what I'm doing wrong and how I keep the field message appearing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 06:46 AM - edited 10-26-2023 06:51 AM
@Ankur Bawiskar In fact, it just works with the onChange client script without the needs for onload client script:
Could I just use the one client script or would I need to use both?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 06:55 AM
yes remove onLoad in that case
Thank you for marking my response as helpful.
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
10-26-2023 09:12 PM
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
10-26-2023 05:26 AM
Hi @matthew_hughes To achieve you can use onChange client script and select the action variable and comment out the return so that the script will run on both onLoad and Onchage and write your showFieldMessage method.
Please mark helpful if it solves your query
Gaurav