Field Messages - showFieldMsg()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2012 01:01 PM
I need help embedding a link into a field message.
I have tried the following...
var str = "here";
if (g_form.getValue('service_type') == 'System Request') {
g_form.showFieldMsg('service_type', 'You are submitting a system request; please provide the following additional information regarding your request: \nCost/Benefit Analysis (Please complete the spreadsheet found ' + str.link('www.something_here.com') + ' and attach to this request using the paperclip icon)', 'info', false);
}
The result was...
You are submitting a system request; please provide the following additional information regarding your request: Cost/Benefit Analysis (Please complete the spreadsheet found a href="www.something_here.com">here a and attach to this request using the paperclip icon)
Any help on this would be great. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2012 08:08 AM
Thanks, Dale! Your solution worked great!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 10:17 AM
Hi Revlass,
Can you please guide me on how it worked?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2023 09:29 AM
I realize this is an old post, but for anyone else who stumbles upon it, I was able to get Dale's solution working in Vancouver in the native UI. This example on the Caller field of the Incident form:
function onLoad() {
// Show an info message with an embedded hypertext link.
var str = "";
var placeholder = "##placeholder##";
g_form.showFieldMsg('caller_id', placeholder, 'info', false);
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.";
}