Which script in ServiceNow populate OOTB alert message if mandatory fields are not filled on a form

Faisal_khan
Tera Contributor

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)

 

Faisal_khan_0-1718941535938.png

 

 

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.

 

Faisal_khan_1-1718941600324.png

 

 

So i want to know which script populates this alert message so that i can control the visibility.

Any help is appreciated. Thanks!

 

 

2 REPLIES 2

Community Alums
Not applicable

Hi @Faisal_khan ,

This is a duplicate question, i already answered in the same question on other link :

https://www.servicenow.com/community/itsm-forum/which-script-in-servicenow-populate-ootb-alert-messa...

 

Sandeep Rajput
Tera Patron
Tera Patron

@Faisal_khan 

I recommend using onChange script on the fields and use

g_form.clearMessages();
to clear the messages on the form.