How to change help text of field based on value present in that field

Sachin G K1
Kilo Sage

Hi All,

 

How to change help text of field based on value present in that field?

for example i have vehicle dropdown field, and it has two values car and bike. so here if bike is selected then field help text should be "bike is selected" and if car is selected then field help text should be "car is selected" .

 

 

 

 

 

 

 

Thanks in Advance,

Sachin

1 ACCEPTED SOLUTION

Sai Kumar B
Mega Sage
Mega Sage

@Sachin G K1 
You can try onChange the client script on your field to display field message with the current value, Use the following code in onChange client script

 

if(newValue) 
{
g_form.showFieldMsg('pass field_name here', 'The value is : '+newValue, 'info');
}

 

If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B

 

 

View solution in original post

3 REPLIES 3

Sai Kumar B
Mega Sage
Mega Sage

@Sachin G K1 
You can try onChange the client script on your field to display field message with the current value, Use the following code in onChange client script

 

if(newValue) 
{
g_form.showFieldMsg('pass field_name here', 'The value is : '+newValue, 'info');
}

 

If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Sachin G K1 

you cannot change help text dynamically.

You can show field message based on value using onChange client script + as suggested by Sai

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

Lavanya Prabaka
Tera Contributor

Hi Sachin,

 

You may also give hint to the field using right click on the field name>configure Dictionary>under Related list you can find the choice. here give the Hint to the choice. It will appear while hovering the choice. OR you may better use show field message based on value in OnChange Client script as Sai suggested.

 

If My answer helps you in anyways mark it as helpful and correct.
Thanks,

Lavanya P