Expanding text field on form

soren_bogvad
Tera Contributor

I have a record producer with a multi line text variable. The record producer is displayed on our Service Portal and the variable have two lines visible.

If text input exceed these two lines a scrollbar appears but that does not provide a very good view of the text.

Is it somehow possible to make the text field on the form expand dependent on the input?
Like we know it from the internal notes and user comments fields on the notes tab in the incident form.

In Chrome you have the option to expand the field manually but the standard browser used is IE11/Edge that does not have this option.

3 REPLIES 3

shruti_tyagi
ServiceNow Employee
ServiceNow Employee

Hi Soran,



Is it just happening on portal? If you open your record producer in desktop view will you get the same issue? Also what build you are on?



Can you please try this :


To allow vertical resizing in browsers that support it, Ctrl+rightclick the form widget, select "Instance in Page Editor" to edit the widget instance (sp_instance record), add the following to the CSS field, and Save:


textarea {
      resize: vertical !important;
}



Thanks


Shruti


If the reply was informational, please like, mark as helpful or mark as correct!


Hi Shruti,



Thank you for your suggestion.


I have tried it and it works to some extend.


In Chrome it locks the field to vertical resize only but does not auto expand when input exceeds the default field size.
I have tried adding the overflow: auto property but still without luck.



textarea{


resize: vertical !important;


overflow: auto;


}



However I does not seem that I will succeed anyway as our corporate browser is IE and the resize property is not supported by Microsoft browsers in any version.


Yes this will just work for vertical resize in browsers that support it . This is documented as a problem which is fixed in Jakarta. There is no public article for this problem yet to share.



Shruti