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

This is the code in the text both



<p><span style="color: #ff0000; font-family: arial, helvetica, sans-serif; font-size: 12pt;">In order to request access to Study Optimizer  you must first complete the necessary Study Optimizer  training:</span></p>


<style type="text/css"><!--


.tg   {border-collapse:collapse;border-spacing:0;}


.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}


.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}


.tg .tg-3a3g{font-size:14px;font-family:Arial, Helvetica, sans-serif !important;;text-align:center;vertical-align:top}


--></style>


<table class="tg" style="undefined;table-layout: fixed; width: 694px;"><colgroup> <col style="width: 263px;" /> <col style="width: 431px;" /> </colgroup>


<tbody>


<tr><th class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Job Role</span></th><th class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">iLearn Curse(s)</span></th></tr>


<tr>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">ICON CTA</span></td>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Study Optimizer  </span><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Application Overview (G10116)</span></td>


</tr>


<tr>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">ICON CTM</span></td>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Study Optimizer  </span><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Application Overview (G10116)</span></td>


</tr>


<tr>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">ICON Feasibility SO Support Team</span></td>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">External Training - Business Applications (GX0002)</span><br /> <br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> OR</span><br /><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Study Optimizer Application Overview (G10116),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Recruitment Planning (G10106),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">SO General User Planning (G10110)</span></td>


</tr>


<tr>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">ICON GFMs</span></td>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">External Training - Business Applications (GX0002)</span><br /> <br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> OR</span><br /><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> Study Optimizer Application Overview (G10116),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Recruitment Planning (G10106),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Planning and Managing Cohort Studies (G10108),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Planing Adjustments (G10109)</span></td>


</tr>


<tr>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">ICON PDs / PM</span></td>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Study Optimizer  </span><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Application Overview (G10116)</span></td>


</tr>


<tr>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">ICON POAs</span></td>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">External Training - Business Applications (GX0002)</span><br /> <br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> OR</span><br /><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> Study Optimizer Application Overview (G10116),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Recruitment Planning (G10106),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Planning and Managing Cohort Studies (G10108),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Planing Adjustments (G10109),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Monitoring Study Progress (G10105),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Monitor Country (G10107),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO Monitor Sites (G10104)</span></td>


</tr>


<tr>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">ICON Site Activation Leads</span></td>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Study Optimizer Application Overview (G10116),</span><br /><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;"> SO General User Planning (G10110)</span></td>


</tr>


<tr>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">ICON Site ID Functional Lead</span></td>


<td class="tg-3a3g"><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Study Optimizer Application Overview (G10116)</span></td>


</tr>


</tbody>


</table>


<p>  </p>


<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #ff0000;">Please ensure that the appropriate training has been completed or the request will be rejected and access will be delayed.</span></p>


rohantyagi
ServiceNow Employee
ServiceNow Employee

Replace your code with this line below. Try.. not sure if this will work.



<table class="tg" style="height: 100%; width: 694px;"><colgroup> <col style="width: 263px;" /> <col style="width: 431px;" /> </colgroup>


<tbody>


that didn't do anything.   I don't think changing the HTML inside the system will do anything as it is just what displays in the HTML text box.   I need to change the size of the text box itself.   I'm guessing some sort of client script is required.


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.  


I was struggling to get resize my HTML field, but this did the trick! Thank you!