Setting Default Font Size for HTML Variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2020 08:36 AM
Hello Community,
I created a Service Catalog Item that includes an HTML variable. The requirement is to set the Default HTML to Verdana font with a font size of 12px. I thought this can be done by updating the source code in the variable, however the default font size still shows as 8px on the request form. Is there something I'm missing or can this not be accomplished? Thanks in advanced.
HTML Source Code:
Request form showing font in 8px:
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2020 10:25 AM
I tried below and it works on my personal instance
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2020 08:42 AM
Hi Kiemo,
There is no way you can set the default font in the HTML field. In servicenow there is a lot of limitation around the HTML field.
The only way is you can set some default text in that field with some font style but not directly change the font style.
Mark helpful and correct if it helps.
Thanks,
CB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2020 08:14 AM
As CB said, there's no way to set the default font style without also entering some text (which your users would then have to clear out).
But you can use an onLoad Catalog Client Script to set a default value whenever the form loads. It should look like this.
Type: OnLoad
Script:
function onLoad() {
g_form.setValue('variable_name_goes here', '<p><p style="font-family:verdana", "font-size:12pt;"></p></p>');
}
Regards,
Chad Crawford