How can I add inside a field info and when the user start typing the info disappeared

Alon Grod
Tera Expert

Hi,

How can I add inside a field info and when the user start typing the info disappeared. for example:

'Please write a short description' inside the short_description field


Screenshot 2024-05-02 at 12.58.59.png

12 REPLIES 12

Robbie
Kilo Patron
Kilo Patron

Hi @Alon Grod,

 

This is easily achieved by leveraging the g_form.getControl() method as demonstrated below.

 

Example syntax:

var desc = g_form.getControl('description');
desc.placeholder ="Example placeholder text";
 
Best practice would be to implement this via a UI Policy ensuring this is called and executed last on the form load. Screenshots are provided below using the 'Description' field on the incident form.
The placeholder text is only visible when the chosen field is empty. As soon as a user starts to type, the placeholder text is removed.
 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.

 

Thanks, Robbie

 

Screenshot 2024-05-02 at 11.53.00.pngScreenshot 2024-05-02 at 11.58.30.pngScreenshot 2024-05-02 at 11.58.17.png

Robbie
Kilo Patron
Kilo Patron

Hi @Alon Grod,

 

My response may have been lost in the thread. Here is a tried and tested solution. 

This is easily achieved by leveraging the g_form.getControl() method as demonstrated below.

 

Example syntax:

var desc = g_form.getControl('description');
desc.placeholder ="Example placeholder text";
 
Best practice would be to implement this via a UI Policy ensuring this is called and executed last on the form load. Screenshots are provided below using the 'Description' field on the incident form.
The placeholder text is only visible when the chosen field is empty. As soon as a user starts to type, the placeholder text is removed.
 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.

 

Thanks, Robbie

 

Robbie_0-1714655926701.png

 

Robbie_1-1714655926702.png

 

Robbie_2-1714655926704.png

 

@Robbie hi its working for a string field like 'Description'. Is there any way of doing this to a reference field or maybe add a help text above or next to the reference field? (Not in record producer but when you want to create an incident from Service Operation Workspace)