How to indicate a default height for a multi line variable field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2013 09:23 AM
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
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2013 11:11 AM
Hi,
You could use a catalog client script like
function onLoad() {
var sd = g_form.getControl('YOUR FIELD NAME');
sd.style.height = '400px';
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2013 10:32 AM
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/