Setting Default Font Size for HTML Variable

keimo
Tera Contributor

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:

find_real_file.png

Request form showing font in 8px:

find_real_file.png

7 REPLIES 7

I tried below and it works on my personal instance

 

https://community.servicenow.com/community?id=community_question&sys_id=0fafbe2ddb58dbc01dcaf3231f96...

 

Regards,

Sachin

Chander Bhusha1
Tera Guru

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

Chad Crawford
Giga Contributor

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