We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

PrashantLearnIT
Tera Sage

Hello Everyone,

In this video, I will cover scenario-based solutions which our implementations might require in various projects.

I have explained how to add Placeholder for certain fields in Change Requests using Client Scripts.

 

 

==========================CLIENT SCRIPTS============================

Table - Change Request
Type - OnLoad
Scripts -

function onLoad() {
//Type appropriate comment here, and begin script below
var short_desc = g_form.getControl('short_description');
var desc = g_form.getControl('description');

short_desc.placeholder = 'Please provide short details about this change.';
desc.placeholder = 'Please provide details in brief, what exactly this change is about.';
}

 

If my video/content helped you in any way, please mark this video/content as BOOKMARK, SUBSCRIBE & HELPFUL

 

Best Regards,

Prashant Kumar (LearnIT)

 

YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant

Blog LearnIT: https://medium.com/@LearnITbyPrashant

Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/

ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635

6 Comments
Dan Gripping
Tera Expert

How do you get this to work in Workspace?

wmcgrath
Tera Expert

@Dan Gripping I've found that you can use g_form.setFieldPlaceholder('field', 'message') to do this.

e.g.

g_form.setFieldPlaceholder('short_description', 'Enter a short, descriptive title for the change request');

 

Rafael Batistot
Kilo Patron

@wmcgrath 

Very usefull, how can i add a css?

wmcgrath
Tera Expert

Hi @Rafael Batistot - you can't use CSS for placeholders as these are text attributes of the text field.

WillieW
Tera Expert

Post a text version if you want to be helpful.

Rafael Batistot
Kilo Patron

Hi @WillieW 

The text "test" in light gray