Which script in ServiceNow populate OOTB alert message if mandatory fields are not filled on a form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 09:01 PM
Hi,
I am working on User registration form. If a user do not fills mandatory fields and click on Register, then it populates OOTB alert message "Error Some fields are incomplete: First name, Last name, Business email address, Business mobile phone" (This is expected)
However, the issue is if i fill all the fields the alert message do not disappear by its own. It stays on the screen even if form is submitted and goes to next page. User has to manually close this alert message.
So i want to know which script populates this alert message so that i can control the visibility.
Any help is appreciated. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 09:13 PM
Hi @Faisal_khan ,
Make sure the property "glide.sc.use_sc_form_v2" is true.
If it's still not going then it might be because of another field with the same label exists in the form layout but is hidden on the form using a UI policy or a client script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 09:55 PM
I recommend using onChange script on the fields and use
g_form.clearMessages();