Insert Link in field msg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2024 08:25 PM
Hi All,
I have a requirement where I need to show below field msg based on the selection
Please proceed with a request for a single use or multi-use card which can be used for both online and tap and go transactions. Click on the below link to see how
<insert link>
I can achieve the text through showFieldMsg() but how can I insert a link in there ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2024 08:43 PM
Hi @Kanika4 ,
try with below code.
showFieldMsg("Please proceed with a request for a single use or multi-use card which can be used for both online and tap and go transactions. Click on the link below to see how: <a href='https://www.example.com' target='_blank'>See how</a>", 'info');
Accept the solution if it helped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 02:22 PM
Not working. This is how it came up on the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 01:09 AM - edited 11-26-2024 01:15 AM
Hello @Kanika4,
It is not possible using g_form.showFieldMsg("<a href='https://www.google.com> See how </a>" ) etc. You can do it using alternative method like DOM manipulation.
Try the below code. Make sure isolate script is unchecked on the client script.
function onLoad() {
g_form.showFieldMsg('short_description', "This will be replaced with below ", 'info');
var x = gel('incident.short_description_fieldmsg'); // <table_name>.<field_nam>_fieldmsg
x.innerHTML = '<div class="fieldmsg-container" id="incident.short_description_fieldmsg" aria-live="polite"><div class="fieldmsg notification notification-info">' + 'Please proceed with a request for a single use or multi-use card which can be used for both online and tap and go transactions. Click on the below link to see how <a href=' + '"https://google.com"' + 'target="_blank"' + '>' + 'This will link out to Google' + '</a>' + '</div>' + '</div>';
}
I have done it on short description field from incident. Refer below screenshot.
Update the code as per your requirement.
Regards,
----
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.