- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 08:25 AM
Hi All,
I have a basic requirement of adding the watermark text on my String field called "justification" which is extended from the task table field "Description". I need watermark text message information in the justification field, which will disappear once you write in that field. Can you guys please help me achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 08:36 AM - edited 12-14-2023 08:39 AM
@Aamir3 You can create on load client script to show placeholder text in the field
function onLoad() {
//Type appropriate comment here, and begin script below
var field = g_form.getControl('description');
field.placeholder = "Test Placeholder";
}
Hope this will resolve your issue.
Thanks,
RJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 08:39 AM
@Aamir3 I believe what you are looking for is called placeholder text which is text that appears in the field but disappears when a user inputs text.
You can achieve this with the following client script (onload):
var field1 = g_form.getControl('fieldName');
field1.placeholder ="Placeholder text";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 08:30 AM
Hi @Aamir3
There is attribute called Example Text , which is available on Variables but not on fields. You can use Default value , but it wil not solve your issue
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 08:36 AM - edited 12-14-2023 08:39 AM
@Aamir3 You can create on load client script to show placeholder text in the field
function onLoad() {
//Type appropriate comment here, and begin script below
var field = g_form.getControl('description');
field.placeholder = "Test Placeholder";
}
Hope this will resolve your issue.
Thanks,
RJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 08:39 AM
@Aamir3 I believe what you are looking for is called placeholder text which is text that appears in the field but disappears when a user inputs text.
You can achieve this with the following client script (onload):
var field1 = g_form.getControl('fieldName');
field1.placeholder ="Placeholder text";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 03:15 AM
Thanks everyone! Now I can achieve my requirements. Much Appreciated!