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-1718942438839.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-1718942452742.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 ,

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.

 

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 from the form.