Change size of html editor

Brian Lancaster
Tera Sage

I have a catalog item that is displaying has an HTML editor to display the training courses that someone need to take before requesting access.   This is displayed on the screen as read only.   Is there a way to make it longer do it does not have a scroll bar?

1 ACCEPTED SOLUTION

rohantyagi
ServiceNow Employee
ServiceNow Employee

Yes you need too write a client script "on Load". Should be as simple as this:



g_form.getControl('<VARIABLE_NAME>').style.height = '150px';



Please refer this article for more details.



If it was a regular field on the form, Field Style configuration in SN could have worked but it is about variable field styling which is not possible without a client script at this time.  


View solution in original post

15 REPLIES 15

Midhun1
Giga Guru

Is this a UI Macro or how did you configure html content in form?


No in the drop down for type in variables there is HTML which is an HTML editor like at the description field in the items.   I am just displaying it as read only.


Midhun1
Giga Guru

<input size="number">


That just created an input field inside the html text box.


rohantyagi
ServiceNow Employee
ServiceNow Employee

I do not have a precise answer as I am no expert in HTML, but please post your HTML code if you can and someone in the community might have answers for you.



If you click on this button, you will find the code.



find_real_file.png



I used height: 100% rather than using 'px' in my code to make it fit to the frame size



find_real_file.png