We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Placeholder for String field on the From

Maria31
Tera Contributor

Hello all,

Could you please advise how to add Placeholder (Example text) to the field on the form in ServiceNow? I need something similar to Example text added to Variables?

 

For example I want to add to Description field to Incident form the following Placeholder (Example text):

find_real_file.png

1 ACCEPTED SOLUTION

You could achieve this with an onLoad client script like the example I created here.

find_real_file.png

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!

View solution in original post

6 REPLIES 6

Create a onload client script 
function
 onLoad() {
    var field = g_form.getElement("u_name");
    if (field) {
        field.setAttribute('placeholder''Enter your name');
        field.style.color = 'red';
        }
}


This Answer might be helpful, It worked for me

AlokD6499012040
Tera Guru

Hi Maria,

You could navigate to field dictionary and set the default value of the field so it will always populate until field value is not overridden by user.

find_real_file.png

Kindly mark my answer as Correct and Helpful based on the Impact.