- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 03:54 AM
I want to add hyperlink as follows but it is not working
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 04:01 AM
Hello @SHALIKAS
- You cannot populate link using g_form.showfieldmsg().
- The g_form.showFieldMsg() method is primarily used to display messages (such as error, warning, or informational messages) below a field.
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 04:01 AM
Hello @SHALIKAS
- You cannot populate link using g_form.showfieldmsg().
- The g_form.showFieldMsg() method is primarily used to display messages (such as error, warning, or informational messages) below a field.
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 04:07 AM
@SHALIKAS Not possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 04:09 AM
is there any way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 04:52 AM - edited 01-27-2025 04:53 AM
Hi @SHALIKAS ,
You can do something like below in client script. You can change the text according to your need.
Again: DOM manipulation is not recommended but it is required then you can use below script.
Make sure to uncheck the filed on client script "Isolate script".
var targetField = 'short_description'; // Replace with your field name
// HTML content to insert
var htmlContent = '<div id="customHtml" style="margin-top: 10px;">' +
'<a href="https://www.example.com" target="_blank">Click here for more information</a>' +
'</div>';
// Ensure the field exists on the form
if (g_form.getControl(targetField)) {
// Get the field's DOM element
var fieldElement = g_form.getControl(targetField).parentNode;
// Check if the custom HTML is already added to prevent duplicates
if (!document.getElementById('customHtml')) {
// Insert the HTML after the field
var div = document.createElement('div');
div.innerHTML = htmlContent;
fieldElement.appendChild(div);
}
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------