Show greyed out text in field & vanish once entered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 04:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 04:41 AM - edited 09-20-2024 06:05 AM
Hi @Community Alums,
This is easily achieved and the solution differs depending on the type of field type and form you're wanting to implement this on.
If (based on your screen shot) it's a catalog item and variable, simple enter the text within the "Example text" field on the variable attributes. (Screen shot below)
If it's a 'task' form such as incident for example, you'd have to handle it with something like a simple onLoad Client Script as below.
Variable:
Client Script:
function onLoad() {
var field = g_form.getElement("short_description"); //name of field where you wish to display the palceholder text
if (field) {
field.setAttribute('placeholder', 'Enter Short Description here...'); //change the text accordingly for your needs
}
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 04:48 AM
Hi @Community Alums
Seems you want to add this text on variable
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
09-20-2024 05:00 AM
Hi @Community Alums It is called a Placeholder and you can add it in Example Text Field on your Variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2024 05:07 AM
It worked fine.
Thanks a lot