How to indicate a default height for a multi line variable field?

valerie_gallot
Giga Expert

Hi,
I have a catalog item with a multi line field "Description".
This description has a default value because we provide some examples to help the end-user to fill in this field...
But unfortunately the field is not high enough to show the complete default value.
The user has to scroll down or click on the Plus sign to expand the area.
That's not convenient.
I couldn't find a way to indicate a default height for a multi line text field...
Could someone help me?
Thanks in advance
Valérie

2 REPLIES 2

Not applicable

Hi,

You could use a catalog client script like

function onLoad() {
var sd = g_form.getControl('YOUR FIELD NAME');
sd.style.height = '400px';
}


tony_fugere
Mega Guru

Mark is kinda my employer's "competition" now, but I gotta link out to him on this one because he has a way to write this so it expands to the height necessary instead of a hard-coded number. 🙂


var fieldName = 'description';
var el = g_form.getControl(fieldName);
el.style.height = el.scrollHeight + 'px';


http://www.servicenowguru.com/scripting/client-scripts-scripting/automatically-adjust-height-text-area-fit-contents/