How to add a message below a particular field

Community Alums
Not applicable

Hi
In Service portal , under a catalog item there is one field name--Test1 (choice field with dropdown options)

Requirement: when we select first option in the Test1 field then a message should pop-up below the field "Test1"

Thanks in Advance!!

2 ACCEPTED SOLUTIONS

Peter Bodelier
Giga Sage

Hi @Community Alums 

 

Please review this article to fulfill your requirement:

 

Configuring 'showErrorBox' and 'showFieldMsg' with hideFieldMsg for a better UI experience - Support and Troubleshooting (servicenow.com)


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

View solution in original post

AnveshKumar M
Tera Sage
Tera Sage

Hi @Community Alums 

Create an onChange client script on field Test1 and use g_form.showFieldMsg("YOUR_FIELD_NAME", "Test 1") to display a field message.

Thanks,
Anvesh

View solution in original post

3 REPLIES 3

Peter Bodelier
Giga Sage

Hi @Community Alums 

 

Please review this article to fulfill your requirement:

 

Configuring 'showErrorBox' and 'showFieldMsg' with hideFieldMsg for a better UI experience - Support and Troubleshooting (servicenow.com)


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

AnveshKumar M
Tera Sage
Tera Sage

Hi @Community Alums 

Create an onChange client script on field Test1 and use g_form.showFieldMsg("YOUR_FIELD_NAME", "Test 1") to display a field message.

Thanks,
Anvesh

Sayali Gurav
Tera Guru
Tera Guru

Hello @Utsav JAISWAL ,

Create onChange client script :

Name : Enter name for client script

Type : onChange 

UI Type : All

Variable name : "Select your variable Name"

Applies on a Catalog Item view : True

Applies on Requested Items : True

Applies on Catalog Tasks : True

SayaliGurav_0-1697460605822.png

g_form.showFieldMsg("enter here your field's backend name", "type here your message", "error");

 

Mark helpful or correct if applicable.

Thanks & Regards,

Sayali Gurav