Add link in info message

alexm3
Kilo Expert

Hello,

I have the following client script:

--------------------

function onChange(control, oldValue, newValue, isLoading) {

  if (newValue == '')

  return;

  if (newValue == 'ABC')

  g_form.addInfoMessage('Please see knowledge article KB0011111');

  else

  g_form.clearMessages();

----------------------

This script will add an info message at the top of the page when value is ABC. My question is, can I make the KB number as a hyperlink so that people could click on the KB number and be redirected to the its page?

Thanks,

Alex

1 ACCEPTED SOLUTION

Inactive_Us1137
Mega Expert

Hi Alexandru, Michal



It is possible to add the link in the addinfomessage. Please find the sample script below.



function onLoad() {


    g_form.addInfoMessage("Please <a href = '/incident_list.do'>Click</a>");


   


}


Replace the above url with the one your looking to add.



Thanks


Abhishek


PS - Please mark this Helpful, Like, or Correct Answer if relevant.


View solution in original post

10 REPLIES 10

Bharath Seelam
Tera Expert

Can we print (gs.info) hyperlink by executing on Scripts - background ? If I try this gs.info("Please <a href = 'http://www.google.com' target='_blank'>Click</a>"); it is just displaying as text.