The CreatorCon Call for Content is officially open! Get started here.

Field message disappearing when clicking on form

matthew_hughes
Kilo Sage

I've created the following client script to show a field message on a form:

matthew_hughes_0-1698322193048.png

 

 

When the form loads, it appears:

matthew_hughes_1-1698322228989.png

 

However, if I click on any part of the form, it disappears:

matthew_hughes_2-1698322264582.png

 

I was just wondering if someone could explain what I'm doing wrong and how I keep the field message appearing.

 

 

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@matthew_hughes 

please create an onChange client script and add the same message as well

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@matthew_hughes 

something like this

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

	g_form.showFieldMsg();

}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

What would I have to select as the Field name?

 

 

 

 

g_form.showFieldMsg('u_effort','Days-Hour-Minute-Seconds','info');

 

 

u_effort - Assuming the backend name of Effort field