HyperLInk in field label
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited 13 hours ago
Hi All,
I have having one req where I want to add a choice field
"Has the demand been reviewed and is it in-line with tech standards and architecture principal?"
where " tech standards" & "architecture principal" are hyperlink in the field display name itself.
Not able to figure out how to do it using annotation ...?
Can anyone suggest me how to do it ...?
Anything would help!!
thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
15 hours ago
This is the only way I've gotten something similar to work - a field message with links
An onLoad Client Script ensuring Isolate script is unchecked after the record is created:
function onLoad() {
// Show Field message with an embedded hypertext link.
var str = "";
var placeholder = "##placeholder##";
g_form.showFieldMsg('u_due_date_term', placeholder, 'info', false); //field name
str = this.document.getElementsByClassName("fieldmsg notification notification-info")[0].innerHTML;
str = str.substring (0, str.indexOf(placeholder));
this.document.getElementsByClassName('fieldmsg notification notification-info')[0].innerHTML = str + "Please <a href='http://www.ibm.com' target = '_blank'>Click here</a> for more information."; //links and text
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago - last edited 11 hours ago
I agree with @Brad Bowman , this works using a client script.
You can implement it by going to System Definition → Client Scripts and creating a new onLoad client script. Fill in the fields as shown in the screenshot.
Paste the script below:
function onLoad() {
// placeholder text
var placeholder = "This is testing for community";
// show a temporary field message
g_form.showFieldMsg(
'u_string_3', // field name
placeholder,
'info',
false
);
// get the field message container
var msgElem = document.getElementsByClassName(
"fieldmsg notification notification-info"
)[0];
// remove placeholder and inject link
msgElem.innerHTML =
"This is your <a href='https://facebook.com' target='_blank'>Facebook</a> Click here for more information.";
}and make sure “Isolate Script” is unchecked, otherwise it may not work.
After saving, reload the form / table and you should see the blue info message with the clickable link below the field.
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11 hours ago
field label only supports text.
Please inform customer about this OOTB limitation/feature
You can use DOM manipulation but it's not recommended practice
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader