Field Messages - showFieldMsg()

revlass
Tera Contributor

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!

17 REPLIES 17

First of Dale, this is still a great solution.



However, people with two or more field messages on a form should be wary: the script will select the first field message on display and alter that. For this reason, I recommend making your placeholder text something meaningful, and ensuring that the message altered is the only 'info' message visible.


Hello Dale,



Would you know how to do your proposed solution on Fuji? This does not seem to work anymore in UI15 anymore. Thanks!


Nevermind, got it to work.


Hi David, 

Can you please guide me on how it worked? 

Thanks

Hi Dale, 

That's exactly what I want, but it doesn't seem to work. Can you please guide me.

Thanks