Is it possible to change text to different font styles???

Divya K1
Tera Guru

Hi All,

We have written client script to prefill the text on font italic like below screenshot for few fields on change form.

find_real_file.png

Now when we type any text for those fields --- it should be in Normal text.. How to translate input text font style to normal text instead of italic.

Here is the onload script i have written to prefill the text for few fields :

Client script

function onLoad() {
 
    
    var shortdescription = "short summary of what will be done under this change record";
    
    var description = "List the planned activities  : \n";

 g_form.setValue("short_description",shortdescription);
    var sd = g_form.getControl('short_description');
    sd.style.color = 'black';
    sd.style.fontStyle = 'italic';
    g_form.setValue("description",description);
    var des = g_form.getControl('description');
    des.style.color = 'black';
    des.style.fontStyle = 'italic';

}

1 REPLY 1

Shane41
ServiceNow Employee
ServiceNow Employee

Hi Divya,

I would recommend adding 'ghost text' in to the fields

See this previous thread:

https://community.servicenow.com/community?id=community_question&sys_id=06dc4729db9cdbc01dcaf3231f96...

Hope this helps,

Shane