HTML Help text

Brian Lancaster
Tera Sage

Does anybody know of a way to make it so that HTML shows in the help test now that ServiceNow is escaping it?   We obviously do not want to set glide.ui.escape_text to false.   Just wondering if there are any other workarounds before we have to upgrade to Fuji Patch 12 Hot fix 1.   We have tables setup to show what the different choices mean on a list collector.

37 REPLIES 37

venkatiyer1
Giga Guru

Hi Brian,




When you say html do you want the tags to show up in the help text or would you like the styles to be applied in the help text?


Out of the box it would render help or tooltip as just pure text more so because it is an attribute of the span tag holding it. I am in Geneva and if i enter Testing <b> Tooltip</b> in Tooltip value of the variable it will show it just like that. If I want the Tooltip to be bold while showing the tooltip you would have to write a custom script to show it.


I want the style to show up.   Where would this script be?     Is this a Client Script, Business rule, etc.?


venkatiyer1
Giga Guru

Hi Brian,



The custom tooltip that are coming on the page are coming due to tooltip plugin that is enabled by default on load of the page.




You need an Onload catalog client script with the following snipped of code inside the onLoad. This code will show the html inside the tooltip defined in the variable as proper html.



function onLoad() {


  // plugin gets initialized later so it needs settimeout to ensure the script is applied later


  window.setTimeout(function(){


  $j('[data-toggle="tooltip"]').each(function( index ) {


  $j(this).off('.tooltip').removeData('bs.tooltip');


  $j(this).tooltip({html : true, placement: 'top', });


  });


  }, 0);


}



This is for new tooltip that comes up with UI 16


I created on onLoad client script on the item in question.   The HTML code still appears instead of the formatted text.