Textarea Size need to increase for Change

venkateshdhanap
Tera Contributor

Hi All,

I need to add place holder text for some fields in Change form. Some place holder texts having multiple lines but Text are of the respective field is less.Hence place holder Text is not fully visible it skips some below rows. Please provide codes to increase size of the field in the Change form.

find_real_file.png

I have added above place holder text as in the screenshot but some below lines are not visible.
i need to increase size of the respective fields

Thanks in Advance

Venkatesh

1 ACCEPTED SOLUTION

Sagar Patro
Kilo Guru

Hi Venkatesh,



You may use onLoad client script for this as follows:



var x = $("change_request.description"); //any field


x.style.height ="350px"; // any pixels



If this doesnot solve what you need you may use autoResize function on jQuery. Reference: Textarea Tricks | CSS-Tricks


$('textarea').autoResize();



Please Hit ✅Correct, ��Helpful, or ��Like depending on the impact of the response


View solution in original post

7 REPLIES 7

I would make sure to check that $("change_request.description") is not undefined before trying to manipulate it. If you use this code and ServiceNow changes the way the form renders where that no longer targets anything you'll end up with a JS error that will affect the way the form loads. I have learned this the hard way over the years...


Hi Brad,
Is there any other defined way to increase the height of text area?


please suggest any other way?


Thanks


Venkatesh


I would use a field style to increase the height so that there is no upgrade risk.



Define field styles



In the style field on the field style you can use something like:


height:120px;